NetCDF Packed Byte data
Charles Seman
Charles.Seman at NOAA.GOV
Mon Nov 6 11:10:59 EST 2006
M.Mahakurur,
Thank you for correcting me with the information from the VARS link...
I had thought the limit was 16 characters... but it says it must be less
than 16 characters... Does anyone else have information related to this?
Thanks,
Chuck
M.Mahakur wrote:
> Respected Dr. Seman,
>
> I had read this two links (you sent) earlier. But, I guess I donot
> need a data descriptor file for the '.nc' files I have, as these are
> SDF (which you can see in the ncdump headers I sent yesterday. It
> seems length of 'vaiable name' should be maximum 15 charcaters, not
> 16. Follwoing line I found in the link:
> http://www.iges.org/grads/gadoc/descriptorfile.html#VARS.
>> /varname/ This is a 1-15 character "name" or abbreviation for the
>> data variable. /varname/ may contain alphabetic and numeric
>> characters but it must start with an alphabetic character (a-z).
> What is why it truncates the 16th alphabet. How can I handle these two
> problems (display packed byte and varname > 15 chars)? I am pasting
> the attributes informations of a file below.
>
> --------------------------
> ga-> sdfopen 20060101-UKMO-L4UHfnd-GLOB-v01.nc
> Scanning self-describing file: 20060101-UKMO-L4UHfnd-GLOB-v01.nc
> SDF file 20060101-UKMO-L4UHfnd-GLOB-v01.nc is open as file 1
> LON set to -179.975 179.975
> LAT set to -89.975 89.986
> LEV set to 0 0
> Time values set: 2006:1:1:12 2006:1:1:12
> ga-> q attr
> Native Attributes for File 1 : OSTIA Sea Surface Temperature Analysis
> global String Conventions CF-1.0
> global String title OSTIA Sea Surface Temperature Analysis
> global String DSD_entry_id UKMO-TSANAL-v01-GLOB
> global String references None
> global String institution UK Met Office
> global String contact john.stark at metoffice.gov.uk
> global String GDS_version_id v1.0-rev1.5
> global String netcdf_version_id 3.6.0-p1 of Jul 4 2005 16:41:16 $
> global String creation_date 2006-01-02 14:00 UTC
> global String product_version 0.1
> global String history Created from sst:temperature from
> /data/local/frhn/OSTIA/analysis/20060102_UKMO_L4UHfnd_GLOB_v01.nc;
> error:; bias:; sea ice:
> global String grid_resolution 0.05000 degree
> global String comment WARNING Some applications are unable to properly
> handle signed byte values. If values are encountered > 127, please
> substract 256 from this reported value
> global String start_date 2006-01-01 UTC
> global String start_time 00:00:00 UTC
> global String stop_date 2006-01-02 UTC
> global String stop_time 00:00:00 UTC
> global Float32 southernmost_latitude -90
> global Float32 northernmost_latitude 90
> global Float32 westernmost_longitude -180
> global Float32 easternmost_longitude 180
> global String file_quality_index 0
> lon String long_name longitude
> lon String units degrees_east
> lat String long_name latitude
> lat String units degrees_north
> time String long_name reference time of sst field
> time String units seconds since 1981-01-01 00:00:00
> sst_foundation String long_name foundation sea surface temperature
> sst_foundation String units kelvin
> sst_foundation Int16 _FillValue -32768
> sst_foundation Float32 add_offset 273.15
> sst_foundation Float32 scale_factor 0.01
> sst_foundation Int16 valid_min -32767
> sst_foundation Int16 valid_max 32767
> sst_foundation String standard_name sea_surface_temperature
> analysis_error String long_name error estimate from the analysis
> analysis_error String units kelvin
> analysis_error Byte _FillValue -128
> analysis_error Float32 add_offset 0
> analysis_error Float32 scale_factor 0.05
> analysis_error Byte valid_min -127
> analysis_error Byte valid_max 127
> bias String long_name analysis error bias
> bias String units kelvin
> bias Byte _FillValue -128
> bias Float32 add_offset 0
> bias Float32 scale_factor 0.01
> bias Byte valid_min -127
> bias Byte valid_max 127
> sea_ice_fractio String long_name sea ice fraction
> sea_ice_fractio String units 1
> sea_ice_fractio Byte _FillValue -128
> sea_ice_fractio Float32 add_offset 0
> sea_ice_fractio Float32 scale_factor 0.01
> sea_ice_fractio Byte valid_min -127
> sea_ice_fractio Byte valid_max 127
> sea_ice_fractio String standard_name sea_ice_area_fraction
> sea_ice_fractio String comment Data derived from OSI-SAF sea ice product
> mask String long_name mask
> mask String comment b0: 1=sea ; b1: 1=land ; b2: 1=lakes ; b3: 1=ice
> ga->
>
> ----------------------------------------
>
> Regards,
>
> M. Mahakur
>
> Charles Seman wrote:
>> M. Mahakur,
>>
>> Have you checked out this web site?
>> http://www.iges.org/grads/gadoc/descriptorfile.html#unpack
>>
>> Not sure why 'sea_ice_fraction' is not displayed... 16 characters is
>> GrADS limit...
>> http://www.iges.org/grads/gadoc/descriptorfile.html#VARS
>>
>> I hope this helps,
>> Chuck
>>
>> M.Mahakur wrote:
>>> Respected GrADS users:
>>>
>>> How can I open the packed netcdf byte data (ncdumped headers of a
>>> single
>>> file I am pasting here)? I could display the variable 'sst_foundation'
>>> using sdfopen. I guess GrADS is taking care of off_set and
>>> scale_factor.
>>> But I could not do for the other variables (i.e.. analysis_error, bias,
>>> sea_ice_fraction and mask), which are packed bytes.
>>>
>>> Secondly, variable 'sea_ice_fraction' is getting truncated to
>>> 'sea_ice_fractio'!!
>>>
>>> Thanks in advance.
>>>
>>> With Regards,
>>>
>>> M. Mahakur
>>>
>>> ---------------------------------------------------
>>> ga-> q file
>>> File 1 : OSTIA Sea Surface Temperature Analysis
>>> Descriptor: 20060101-UKMO-L4UHfnd-GLOB-v01.nc
>>> Binary: 20060101-UKMO-L4UHfnd-GLOB-v01.nc
>>> Type = Gridded
>>> Xsize = 7200 Ysize = 3600 Zsize = 1 Tsize = 1
>>> Number of Variables = 5
>>> sst_foundation 0 -999 foundation sea surface temperature
>>> analysis_error 0 -999 error estimate from the analysis
>>> bias 0 -999 analysis error bias
>>> sea_ice_fractio 0 -999 sea ice fraction
>>> mask 0 -999 mask
>>>
>>>
>>> ---------Headers from ncdump------------------------------------
>>> netcdf 20060101-UKMO-L4UHfnd-GLOB-v01 {
>>> dimensions:
>>> lon = 7200 ;
>>> lat = 3600 ;
>>> time = 1 ;
>>> variables:
>>> int time(time) ;
>>> time:long_name = "reference time of sst field" ;
>>> time:units = "seconds since 1981-01-01 00:00:00" ;
>>> float lat(lat) ;
>>> lat:long_name = "latitude" ;
>>> lat:units = "degrees_north" ;
>>> float lon(lon) ;
>>> lon:long_name = "longitude" ;
>>> lon:units = "degrees_east" ;
>>> short sst_foundation(time, lat, lon) ;
>>> sst_foundation:long_name = "foundation sea surface
>>> temperature" ;
>>> sst_foundation:units = "kelvin" ;
>>> sst_foundation:_FillValue = -32768s ;
>>> sst_foundation:add_offset = 273.15f ;
>>> sst_foundation:scale_factor = 0.01f ;
>>> sst_foundation:valid_min = -32767s ;
>>> sst_foundation:valid_max = 32767s ;
>>> sst_foundation:standard_name =
>>> "sea_surface_temperature" ;
>>> byte analysis_error(time, lat, lon) ;
>>> analysis_error:long_name = "error estimate from the
>>> analysis" ;
>>> analysis_error:units = "kelvin" ;
>>> analysis_error:_FillValue = -128b ;
>>> analysis_error:add_offset = 0.f ;
>>> analysis_error:scale_factor = 0.05f ;
>>> analysis_error:valid_min = -127b ;
>>> analysis_error:valid_max = 127b ;
>>> byte bias(time, lat, lon) ;
>>> bias:long_name = "analysis error bias" ;
>>> bias:units = "kelvin" ;
>>> bias:_FillValue = -128b ;
>>> bias:add_offset = 0.f ;
>>> bias:scale_factor = 0.01f ;
>>> bias:valid_min = -127b ;
>>> bias:valid_max = 127b ;
>>> byte sea_ice_fraction(time, lat, lon) ;
>>> sea_ice_fraction:long_name = "sea ice fraction" ;
>>> sea_ice_fraction:units = "1" ;
>>> sea_ice_fraction:_FillValue = -128b ;
>>> sea_ice_fraction:add_offset = 0.f ;
>>> sea_ice_fraction:scale_factor = 0.01f ;
>>> sea_ice_fraction:valid_min = -127b ;
>>> sea_ice_fraction:valid_max = 127b ;
>>> sea_ice_fraction:standard_name =
>>> "sea_ice_area_fraction" ;
>>> sea_ice_fraction:comment = "Data derived from OSI-SAF
>>> sea ice product" ;
>>> byte mask(time, lat, lon) ;
>>> mask:long_name = "mask" ;
>>> mask:comment = "b0: 1=sea ; b1: 1=land ; b2: 1=lakes ;
>>> b3: 1=ice" ;
>>>
>>> // global attributes:
>>> :Conventions = "CF-1.0" ;
>>> :title = "OSTIA Sea Surface Temperature Analysis" ;
>>> :DSD_entry_id = "UKMO-TSANAL-v01-GLOB" ;
>>> :references = "None" ;
>>> :institution = "UK Met Office" ;
>>> :contact = "john.stark at metoffice.gov.uk" ;
>>> :GDS_version_id = "v1.0-rev1.5" ;
>>> :netcdf_version_id = "3.6.0-p1 of Jul 4 2005 16:41:16
>>> $" ;
>>> :creation_date = "2006-01-02 14:00 UTC" ;
>>> :product_version = "0.1" ;
>>> :history = "Created from sst:temperature from
>>> /data/local/frhn/OSTIA/analysis/20060102_UKMO_L4UHfnd_GLOB_v01.nc;
>>> error:; bias:; sea ice:" ;
>>> :grid_resolution = " 0.05000 degree" ;
>>> :comment = "WARNING Some applications are unable to
>>> properly handle signed byte values. If values are encountered > 127,
>>> please substract 256 from this reported value" ;
>>> :start_date = "2006-01-01 UTC" ;
>>> :start_time = "00:00:00 UTC" ;
>>> :stop_date = "2006-01-02 UTC" ;
>>> :stop_time = "00:00:00 UTC" ;
>>> :southernmost_latitude = -90.f ;
>>> :northernmost_latitude = 90.f ;
>>> :westernmost_longitude = -180.f ;
>>> :easternmost_longitude = 180.f ;
>>> :file_quality_index = "0" ;
>>> data:
>>>
>>> time = 788961600 ;
>>>
>>> lat = -89.975, -89.925, -89.875, -89.825, -89.775, -89.725, -89.675,
>>> -89.625, -89.575, -89.525, -89.475, -89.425, -89.375, -89.325,
>>> -89.275,
>>
>> --
>>
>> Please note that Charles.Seman at noaa.gov should be considered my NOAA
>> email address, not cjs at gfdl.noaa.gov.
>>
>> ********************************************************************
>> Charles Seman Charles.Seman at noaa.gov
>> U.S. Department of Commerce / NOAA / OAR
>> Geophysical Fluid Dynamics Laboratory voice: (609) 452-6547
>> 201 Forrestal Road fax: (609) 987-5063
>> Princeton, NJ 08540-6649 http://www.gfdl.noaa.gov/~cjs/
>> ********************************************************************
>>
>> "The contents of this message are mine personally and do not reflect
>> any position of the Government or NOAA."
>>
>
--
Please note that Charles.Seman at noaa.gov should be considered my NOAA
email address, not cjs at gfdl.noaa.gov.
********************************************************************
Charles Seman Charles.Seman at noaa.gov
U.S. Department of Commerce / NOAA / OAR
Geophysical Fluid Dynamics Laboratory voice: (609) 452-6547
201 Forrestal Road fax: (609) 987-5063
Princeton, NJ 08540-6649 http://www.gfdl.noaa.gov/~cjs/
********************************************************************
"The contents of this message are mine personally and do not reflect
any position of the Government or NOAA."
More information about the gradsusr
mailing list