[gradsusr] NETCDF4 problem
Ricardo Hallak
ricardo.hallak at iag.usp.br
Sat Mar 10 07:34:07 EST 2018
Conrado,
please, try open the data with a control file similar to this one below:
dset ndvi3g_geo_v1_1981_0712.nc4
UNDEF -5000
dtype netcdf
*
XDEF 4320 LINEAR -180.0 0.083333333
YDEF 2160 LINEAR -90.0 0.083333333
*
TDEF 12 LINEAR 01212jul1981 15DY
*
ZDEF 1 LEVELS 1000
VARS 1
ndvictl=>ndvi 1 t,z,y,x NDVI GRIDDED DATA [[ units ]]
ENDVARS
-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-
Save this as a control file, for example: ndvi1981.ctl, and open it in
grads.
In LINUX:
grads -pc 'open ndvi1981.ctl'
and
d ndvictl
to see if it works.
This .ctl was built accordingly to the necdump above. As, obviously, I
haven't tested this .ctl with your data, it is possible that it is missing
something or it needs a few corrections to work with your data file.
Note that the choice of using the varname "ndvictl" is arbitrary. It could
be another varname, or even ndvi, as I know.
Let me now if there is yet some problem with this.
Regards,
--
Prof. Ricardo Hallak
Laboratório de Meteorologia de Mesoescala - LMM
Departamento de Ciências Atmosféricas
Instituto de Astronomia, Geofísica e Ciências Atmosféricas
Universidade de São Paulo
Phone: +55(11)3091-4698
2018-03-09 10:26 GMT-03:00 <jorge.conrado at cptec.inpe.br>:
>
>
> Hi,
>
>
> I have some NDI data in netcdf4 format, here is the result of the ncdfdump
> for my data:
>
>
> ncdump -h ndvi3g_geo_v1_1981_0712.nc4
> netcdf ndvi3g_geo_v1_1981_0712 {
> dimensions:
> lon = 4320 ;
> lat = 2160 ;
> time = 12 ;
> variables:
> double lon(lon) ;
> double lat(lat) ;
> double time(time) ;
> short satellites(time) ;
> short ndvi(time, lat, lon) ;
> ndvi:units = "1" ;
> ndvi:scale = "x 10000" ;
> ndvi:missing_value = -5000. ;
> ndvi:valid_range = -0.3, 1. ;
> short percentile(time, lat, lon) ;
> percentile:units = "%" ;
> percentile:scale = "x 10" ;
> percentile:flags = "flag 0: from data flag
> 1: spline interpolation flag 2: possible snow/cloud cover" ;
> percentile:valid_range = "flag*2000 + [0 1000]" ;
>
> // global attributes:
> :FileName = "ndvi3g_geo_v1_1981_0712.nc4" ;
> :Institution = "NASA/GSFC GIMMS" ;
> :Data = "NDVI3g version 1" ;
> :Reference = "1. Pinzon, J.E.; Tucker, C.J.
> A Non-Stationary 1981-2012 AVHRR NDVI3g Time
> Series. Remote Sens. 2014, 6, 6929-6960.
> 2. Pinzon, J.E.; Tucker, C.J.
> A Non-Stationary 1981-2015 AVHRR NDVI3g.v1 Time Series: an
> update. Remote Sens. 2016, in preparation
> " ;
> :CommentsVersion1 = "version1 includes two major fixes (a
> and b), and three minor (c-g): (a) Reprocessed Level 2 entire SeaWIFS
> mission for the land products to reduce artifacts in the data,
> particularly changes in calibration after 2006 that generates drops in
> ndvi lower values. OB.DAAC / Ocean Biology Processing
> group NASA/GSFC 616 (april 2016) (b) Recovered ndvi negative values of
> snow-covered regions in winter Northern latitudes. In Version0, we
> masked them with zero values, creating artifacts in phenology
> parameters. (c) Arranged data in ncd format,
> compiled it in two nc4 files a year. Each nc4 file includes 6 months
> of ndvi data (jan-jun and jul-dec), with a total of 12 (15-day)
> composites each semester. (d) Rescaled ndvi values and
> splitted the flag values from them. (e) Added a new variable,
> percentile, to represent the distribution of ndvi values in the time
> series. Range 10*[0, 100] (f) Flag values are (simpler):
> flag 0: ndvi without apparent
> issues (good value) flag 1: ndvi retrieved from
> spline interpolation flag 2: ndvi retrieved from
> seasonal profile (possible snow/cloud) (g) Flag values are embeded on the
> percentile variable: 2000*flag + percentile. Thus, the
> actual percentile three ranges [0 1000], [2000 3000] and [4000 5000]
> could provide direct information of how interpolation is
> affecting the time series. " ;
> :Temporalrange = "1981-07-01 -> 2015-12-31" ;
> :Year = 1981. ;
> :RangeSemester = "Jul 1 - Dec 31 (7:0.5:12.5)" ;
> :SpatialResolution = "1/12 x 1/12 degrees" ;
> :TemporalResolution = "1/24 a year" ;
> :_fill_val = -32768. ;
> :NorthernmostLatitude = "90" ;
> :SouthernmostLatitude = "-90" ;
> :WesternmostLongitude = "-180" ;
> :EasternmostLongitude = "180" ;
> }
>
>
> Then I did: grads -p
>
> sdfopen ndvi3g_geo_v1_1981_0712.nc4
>
> and I had:
>
> Scanning self-describing file: ndvi3g_geo_v1_1981_0712.nc4
> gadsdf: SDF file has no discernable X coordinate.
>
>
> Please, what can I do to solve this.
>
>
>
> Thanks,
>
>
> Conrado
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20180310/0a253092/attachment-0001.html>
More information about the gradsusr
mailing list