<div dir="ltr"><div class="gmail_default" style="font-size:small">Vimal,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">For one, NCL doesn't *not* automatically apply scale_factor / add_offset type of attributes. This either has to be done directly by you (which I assume you did here), or else you have to use one of the "short2flt", "byte2flt", type of functions that apply the attributes for you.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Also, when you do straight multiply / add operations, NCL will not update the "units" attribute for you, because it has no way of knowing what kind of conversion you are applying. It is up the user to make the correction to the "units" attribute.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8px">heat@units = "degC"</span><br></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8px"><br></span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8px">--Mary</span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 9, 2016 at 4:39 AM, Vimal Koul <span dir="ltr"><<a href="mailto:koulvimal18@gmail.com" target="_blank">koulvimal18@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Sorry, There is a correction in my previous mail.<br><br>The offset and scale is being applied correctly but the units are not being changed.<br><br></div><div>So the issue is with the units of the read variable not the value.<br></div><div><br></div><div>Thanks <br>Vimal<br></div> <br></div><div class="gmail_extra"><br clear="all"><div><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><font size="2">Regards,<br></font></div><font size="2">Vimal Koul</font><br><br></div></div></div></div></div></div></div></div></div><div><div class="h5">
<br><div class="gmail_quote">On 9 February 2016 at 16:59, Vimal Koul <span dir="ltr"><<a href="mailto:koulvimal18@gmail.com" target="_blank">koulvimal18@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Dear all,<br><br></div><div>I have a variable with the following description. <br></div><div><br> float temperature ( time, depth, lat, lon )<br> long_name : temperature<br> standard_name : sea_water_potential_temperature<br> units : kelvin<br> _FillValue : -32768<br> add_offset : 273.15<br> scale_factor : 1<br> valid_min : -5<br> valid_max : 45<br><br><br></div><div>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". <br><br>h = addfile("<a href="http://HadIProfile_201305_2.5deg.nc" target="_blank">HadIProfile_201305_2.5deg.nc</a>","r")<br><br>heat = h->temperature(0,{0:305},:,:)<br><br>printVarSummary(heat)<br><br>Variable: heat<br>Type: float<br>Total Size: 787968 bytes<br> 196992 values<br>Number of Dimensions: 3<br>Dimensions and sizes: [depth | 19] x [lat | 72] x [lon | 144]<br>Coordinates: <br> depth: [5.02159..270.5341]<br> lat: [88.75..-88.75]<br> lon: [1.25..358.75]<br>Number Of Attributes: 8<br> time : 77932.5<br> standard_name : sea_water_potential_temperature<br> long_name : temperature<br> units : kelvin<br> add_offset : 273.15<br> scale_factor : 1<br> _FillValue : -32768<br> missing_value : -32768<br><br><br>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? <br><br></div><div>Any suggestions would be helpful. <br></div><div></div><div><br></div><div><div><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><font size="2">Thanks,<br></font></div><font size="2">Vimal</font><br><br></div></div></div></div></div></div></div></div></div>
</div></div></div>
</blockquote></div><br></div></div></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>