[ncl-talk] hdf5 file in ncl

Mary Haley haley at ucar.edu
Tue Nov 14 15:57:12 MST 2017


Hi Debasish,

This is an HDF-EOS2 file, which you can see if you do an ncl_filedump on
the file and look at the top part of the output:

Variable: f
Type: file
filename:       MYDAODHD.A2017305.0000.061.NRT
path:   MYDAODHD.A2017305.0000.061.NRT.hdf
   file global attributes:
      HDFEOSVersion : HDFEOS_V2.19

Try adding ".he2" to the end of the filename in your script. This will tell
NCL to try opening the file as an HDF-EOS2 file:

 diri = "./November2017/1/"
 fili = "MYDAODHD.A2017305.0000.061.NRT.hdf.*he2*"
​ ​
pthi = diri+fili
 w = addfile(pthi,"r")

It is not necessary to rename the file itself. The "addfile" command will
first look for a file called "MYDAODHD.A2017305.0000.061.NRT.hdf.he2", and
if it can't find that, it will look for the file
"MYDAODHD.A2017305.0000.061.NRT.hdf", but will try to open it as an
HDF-EOS2 file.

Once you do this, the
​file will look much more reasonable.

--Mary

On Tue, Nov 14, 2017 at 2:20 PM, Debasish Hazra <debasish.hazra5 at gmail.com>
wrote:

> Hi,
>
> I am trying to read attached HDF5 file using ncl v6.4 but not able to
> extract data attributes from "Group".
>
>  diri = "./November2017/1/"
>      fili = "MYDAODHD.A2017305.0000.061.NRT.hdf"
>
>             pthi = diri+fili
>             w = addfile(pthi,"r")
>             mod1 = "Aerosol_Optical_Depth"
>             Latitude = "Latitude"
>             Longitude = "Longitude"
>             print(mod1)
>              gp = w->GeoField
>
> Variable: mod1
> Type: string
> Total Size: 8 bytes
>             1 values
> Number of Dimensions: 1
> Dimensions and sizes:   [1]
> Coordinates:
> (0)     Aerosol_Optical_Depth
> fatal:["Execute.c":6397]:variable (GeoField) is not in file (w)
>
> Not sure how to proceed with that. Any help is appreciated.
>
> Debasish
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171114/10bbef6a/attachment.html>


More information about the ncl-talk mailing list