[ncl-talk] Scale and offset not being applied to float type variables

Vimal Koul koulvimal18 at gmail.com
Tue Feb 9 04:29:22 MST 2016


Dear all,

I have a variable with the following description.

 float temperature ( time, depth, lat, lon )
         long_name :    temperature
         standard_name :    sea_water_potential_temperature
         units :    kelvin
         _FillValue :    -32768
         add_offset :    273.15
         scale_factor :       1
         valid_min :    -5
         valid_max :    45


When I read this variable in NCL, the values are in degrees Celsius and not
in Kelvin even though a printVarSummary gives the units as "Kelvin".

h      = addfile("HadIProfile_201305_2.5deg.nc","r")

heat = h->temperature(0,{0:305},:,:)

printVarSummary(heat)

Variable: heat
Type: float
Total Size: 787968 bytes
            196992 values
Number of Dimensions: 3
Dimensions and sizes:    [depth | 19] x [lat | 72] x [lon | 144]
Coordinates:
            depth: [5.02159..270.5341]
            lat: [88.75..-88.75]
            lon: [1.25..358.75]
Number Of Attributes: 8
  time :    77932.5
  standard_name :    sea_water_potential_temperature
  long_name :    temperature
  units :    kelvin
  add_offset :    273.15
  scale_factor :     1
  _FillValue :    -32768
  missing_value :    -32768


It seems NCL is not using the scale/add_offset for float-type variables
like it does for short-type or did I miss something?

Any suggestions would be helpful.

Thanks,
Vimal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160209/c00e37bb/attachment.html 


More information about the ncl-talk mailing list