display hgt.200812.nc (netcdf offsets and scaling factors)

Kevin M Levey klevey at CUSTOMWEATHER.COM
Mon Sep 28 13:59:05 EDT 2009


MON 28SEP09: 1055PDT

Dear Emily,

Not sure what dataset you are using, but here is a ncdump of a NCEP
Reanalysis netcdf file of SLP:

  ncdump -c slp.2009.nc
netcdf slp.2009 {
dimensions:
         lon = 144 ;
         lat = 73 ;
         time = UNLIMITED ; // (261 currently)
variables:
         float lat(lat) ;
                 lat:units = "degrees_north" ;
                 lat:actual_range = 90.f, -90.f ;
                 lat:long_name = "Latitude" ;
         float lon(lon) ;
                 lon:units = "degrees_east" ;
                 lon:long_name = "Longitude" ;
                 lon:actual_range = 0.f, 357.5f ;
         double time(time) ;
                 time:units = "hours since 1-1-1 00:00:0.0" ;
                 time:long_name = "Time" ;
                 time:actual_range = 17601816., 17608056. ;
                 time:delta_t = "0000-00-01 00:00:00" ;
                 time:avg_period = "0000-00-01 00:00:00" ;
         short slp(time, lat, lon) ;
                 slp:long_name = "mean Daily Sea Level Pressure" ;
                 slp:valid_range = 87000.f, 115000.f ;
                 slp:actual_range = 93602.5f, 110540.f ;
                 slp:units = "Pascals" ;
                 slp:add_offset = 119765.f ;
                 slp:scale_factor = 1.f ;
                 slp:missing_value = 32766s ;
                 slp:precision = 0s ;
                 slp:least_significant_digit = -1s ;
                 slp:GRIB_id = 2s ;
                 slp:GRIB_name = "PRMSL" ;
                 slp:var_desc = "Sea Level Pressure\n",
                         "P" ;
                 slp:dataset = "NCEP Reanalysis Daily Averages" ;
                 slp:level_desc = "Sea Level\n",
                         "I" ;
                 slp:statistic = "Mean\n",
                         "M" ;
                 slp:parent_stat = "Individual Obs\n",
                         "I" ;

// global attributes:
                 :Conventions = "COARDS" ;
                 :title = "mean daily NMC reanalysis (2009)" ;
                 :history = "created 2009/01 by Hoop (netCDF2.3)" ;
                 :description = "Data is from NMC initialized
reanalysis\n",
                         "(4x/day).  It consists of most variables
interpolated to\n",
                         "pressure surfaces from model (sigma)
surfaces." ;
                 :platform = "Model" ;

What one has to do to get the correct value is apply both the scale
factor and offset value to the data, so for example, if I wanted to
display SLP, I'd need to do this for example:


'define mslp1 = slp + 119765'

actual value = value * scaling factor + offset, in the example above,
the scaling factor is 1, hence I merely added the offset.

Your netcdf file probably has these values which you merely need to
apply as shown above.

Regards,

Kevin M Levey, MSc in Oceans and Atmospheric Sciences (University of
Cape Town)
Director of Meteorological Operations
CustomWeather, Inc.
San Francisco, California, USA

"Taking the World by Storm!"

http://www.customweather.com
http://www.myforecast.com
http://www.1stweather.com

cell: 415-794-0411
work: 415-777-3566
email: klevey at customweather.com

On Sep 28, 2009, at 09/28/09 - 10:47 AM, Emily wrote:

> Hi group members,
>
> I face a problem when I display 500 hpa geopotential height chart,
> it shows wrong data.
>
> My gs file is:
> 'reinit'
> 'open d:\gradsfile\ncdata\hgt200812.ddf'
> 'set grads off'
> 'set grid off'
> 'set lon 220 310'
> 'set lat 20 60'
> 'set lev 500'
> 'set time 09z28dec2008'
> 'd hgt'
> ====================
> My ddf is as below:
> DSET d:\gradsfile\ncdata\hgt.200812.nc
> DTYPE netcdf
> TITLE NARR 4D field Lambert Conformal Conic projection
> UNDEF 32766 missing_value
> UNPACK scale_factor add_offset
> PDEF 349 277 lcc 1 -145.5 1 1 50 50 -107 32463.41 32463.41
> XDEF 615 linear 150 0.3333
> YDEF 255 linear 2 0.3333
> ZDEF 29 levels 1000, 975, 950, 925, 900, 875, 850, 825, 800, 775,
> 750, 725, 700,
>  650, 600, 550, 500, 450, 400, 350, 300, 275, 250, 225, 200, 175,
> 150, 125, 100
> tdef 248 linear 00:00z01dec2008 3hr
> vars 3
> hgt 29 t,z,y,x  geopotential_height
> lat=>glat 0 y,x Latitude
> lon=>glon 0 y,x Longitude
> endvars
> =============
> My grads version: Grads 2.0 a3,
> window xp
>
> I notice that the contours laber values are like -25900, -25800.....
> I think the value is wrong. Then I check ncdump information, the hgt
> value from ncdump also shows like -25900,.....
>
> Is there some one knowing what wrong with this?Thanks very much.
>
> Regards,
>
> Emily
> York University, Toronto, Canada.
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20090928/674bb328/attachment.html 


More information about the gradsusr mailing list