Hi wei, thanks, this helps a lot.
Regards
Hi wei, thanks for the help.I don’t understand why same code yields different results for var_f (in my case)under ncl-6.1.0 and 6.2.0?As commented in the code, using 6.1.0, the var_f prints my desired one, which is -99,but in 6.2.0, var_f will print -9900.原始邮件发件人: Wei Huang<huangwei@ucar.edu>收件人: Cheung<zuibeidemei@126.com>抄送: NCL<ncl-talk@ucar.edu>发送时间: 2014年4月29日(周二) 21:41主题: Re: [ncl-talk] A question about processing HDF-eos when using ncl-6.2.0Cheung,Your code:filein = "2009200040119_17152_CS_2B-TAU_GRANULE_P_R04_E02.hdf"eos_file = addfile(filein+".he2","r");read using eos filevar = eos_file->layer_optical_depth_2B_TAUvar_f = short2flt(eos_file->layer_optical_depth_2B_TAU)/100which var read for the he2 directly, and NCL show it as short:Variable: var (subsection)Type: shortTotal Size: 8 bytes4 valuesNumber of Dimensions: 1Dimensions and sizes: [nray_2B_TAU | 4]Coordinates:Number Of Attributes: 9factor : 100offset : 0long_name : Layer cloud optical depthunits : -valid_range : ( 0, 5000 )missing : -9900missop : ==_FillValue : 0hdfeos_name : layer_optical_depth(0) -9900(1) -9900(2) -9900(3) -9900When you use short2flt, NCL has the (scale-)factor multiplied to the var, and then return as float.see the print:Variable: var_f (subsection)Type: floatTotal Size: 16 bytes4 valuesNumber of Dimensions: 1Dimensions and sizes: [4]Coordinates:Number Of Attributes: 1_FillValue : 0(0) -9900(1) -9900(2) -9900(3) -9900In most the case, when the data is short, and has factor and offset,you can get the original value as:new_var = ori_var * tofloat(factor) + tofloat(offset)That is what short2flt does.See document for short2flt at:In your case, you may want to do:new_var = ori_var / tofloat(factor)You do not need the offset, as it is zero for your case.Hope this help:WeiOn Apr 28, 2014, at 9:37 PM, Cheung <zuibeidemei@126.com> wrote:Hi Wei:
Thanks for your response.
I put an example online https://github.com/slashgithub/test_2btau,
which contains data and test script, please download and check it.
---
Regards
Cheung
At 2014-04-29 00:53:57,"Wei Huang" <huangwei@ucar.edu> wrote:
Cheung,Can you point us a data you are using, so we can take a look?Thanks,WeiOn Apr 23, 2014, at 6:23 AM, Cheung <zuibeidemei@126.com> wrote:Dear all:
I just came across a different result when I use ncl-6.2.0 processing the HDF-eos file from CloudSat, before I was using 6.1.0.
This particular variable is layer_optical_depth from 2b-tau as documented http://www.cloudsat.cira.colostate.edu/dataSpecs.php?prodid=2.
I used to use:
var = short2flt(eos_file->layer_optical_depth_2B_TAU)/100 to retreive the "actual" value in float from this file due to a factor of 100.
However, in this new version, I found I need to "xxxxx/10000" to retreive the "actual" value in float.
I'm not sure what happen during this process, any comment is appreciated.
Regards
Cheung
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Apr 29 22:45:57 2014
This archive was generated by hypermail 2.1.8 : Sun May 04 2014 - 12:38:56 MDT