[ncl-talk] help reading hdf file
Dennis Shea
shea at ucar.edu
Wed Sep 18 15:30:22 MDT 2019
*https://www.ncl.ucar.edu/Applications/cloudsat.shtml*
<https://www.ncl.ucar.edu/Applications/cloudsat.shtml>
Several examples illustrate importing HDF-EOS files.
See: cloudsat_2.ncl, cloudsat_3.ncl
diri = "./" ; path to file
fili = "2010153190053_21792_CS_2B-CLDCLASS_GRANULE_P_R04_E03.hdf"
varname = "cloud_scenario_2B_CLDCLASS"
f = *addfile *(diri+fili*+".he2"*, "r") ; open file as hdf-eos2
On Wed, Sep 18, 2019 at 3:22 PM Manisha Ganeshan <
manisha.ganeshan86 at gmail.com> wrote:
> Thanks! I did read the file using ncl_filedump, but didn't think the file
> type was relevant.
> Anyway, thanks for resolving my query. I appreciate your help.
>
> Regards,
> Nisha
>
> On Wed, Sep 18, 2019 at 4:57 PM Dennis Shea <shea at ucar.edu> wrote:
>
>> This type of question has been asked numerous time on ncl-talk. These *CloudSat
>> *files are *HDF-EOS*. The golden rule of data processing is "Look at the
>> data!"
>>
>>
>> %>* ncl_filedump*
>> <https://www.ncl.ucar.edu/Document/Tools/ncl_filedump.shtml>
>> 2010024150054_19911_CS_2B-FLXHR-LIDAR_GRANULE_P2_R04_E03.hdf
>>
>> Variable: f
>> Type: file
>> filename: 2010024150054_19911_CS_2B-FLXHR-LIDAR_GRANULE_P2_R04_E03
>> path: 2010024150054_19911_CS_2B-FLXHR-LIDAR_GRANULE_P2_R04_E03.hdf
>> file global attributes:
>> *HDFEOSVersion : HDFEOS_V2.5*
>> ---------
>>
>> As noted in previous ncl-talk responses, append .*he2 *
>>
>> *%> ncl_filedump
>> <https://www.ncl.ucar.edu/Document/Tools/ncl_filedump.shtml> *
>> 2010024150054_19911_CS_2B-FLXHR-LIDAR_GRANULE_P2_R04_E03.hdf*.he2*
>>
>> The .he2 extension tell NCL to use HDFEOS software to provide value-added
>> information.
>>
>> The .he2 flattens the file. It makes it look like a standard netCDF
>> file. It appends a name extension for assorted reasons.
>>
>> %>* ncl_filedump*
>> <https://www.ncl.ucar.edu/Document/Tools/ncl_filedump.shtml>
>> 2010024150054_19911_CS_2B-FLXHR-LIDAR_GRANULE_P2_R04_E03.hdf
>>
>> The variables will have a 2B_FLXHR_LIDAR appended
>>
>> f = addfile("2010024150054_19911_CS_2B-FLXHR-LIDAR_GRANULE_P2_R04_E03.hdf
>> *.he2"*,"r")
>>
>> height = f->Height_2B_FLXHR_LIDAR
>> lon = f->Longitude_2B_FLXHR_LIDAR
>> FD_NA = f->FD_NA_2B_FLXHR_LIDAR
>> FD = FD_2B_FLXHR_LIDAR
>>
>>
>>
>> On Wed, Sep 18, 2019 at 12:53 PM Manisha Ganeshan via ncl-talk <
>> ncl-talk at ucar.edu> wrote:
>>
>>> Hello,
>>>
>>> I'm trying to read the attached hdf file using the addfile function.
>>> I'm able to read the variables (Height, FD, FD_NC, and so on) directly
>>> from the file, but I also need to read the 11 GeoFields and 39 DataFields
>>> listed under groups. Any thoughts on how I can read these fields?
>>>
>>> I've tried the following, that doesn't seem to work.
>>>
>>> g = f=>GeoField
>>>
>>> When I type printVarSummary(g), I get the following output indicating
>>> that no variables are read.
>>>
>>> Variable: g
>>>
>>> Type: file
>>>
>>> File path:
>>> /data10/mganesha/CloudSat/2010024150054_19911_CS_2B-FLXHR-LIDAR_GRANULE_P2_R04_E03.hdf
>>>
>>> Number of global attributes: 2
>>>
>>> Number of dimensions: 7
>>>
>>> Number of variables: 0
>>>
>>> Could you advice on how to proceed?
>>>
>>> Thanks,
>>> Nisha
>>> 2010024150054_19911_CS_2B-FLXHR-LIDAR_GRANULE_P...
>>> <https://drive.google.com/file/d/12rdpMVRppvIlgb3zSBOmAS0nmi78C83X/view?usp=drive_web>
>>>
>>>
>>> --
>>> Dr. Manisha Ganeshan
>>> Universities Space Research Association
>>> Maryland, U.S.A.
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
> --
> Dr. Manisha Ganeshan
> Universities Space Research Association
> Maryland, U.S.A.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190918/a7292c50/attachment.html>
More information about the ncl-talk
mailing list