[ncl-talk] Attempting to read output *.hdf or *.nc files

Rick Brownrigg brownrig at ucar.edu
Tue Dec 17 15:45:51 MST 2019


I concur with Dennis -- I was able to read both files fine and print values
from the variable GBIN. Do you get error messages, or otherwise what do you
mean by "...not able to read...".  I would note that support for HDF is
optional in NCL, although all official binary distros have support
enabled.  However the netCDF file appears to be generic netcdf3 classic,
and any version of NCL should be able to read that.



On Tue, Dec 17, 2019 at 3:21 PM Dennis Shea via ncl-talk <ncl-talk at ucar.edu>
wrote:

> I have no idea why you are having issues.
>
>   dirhdf = "./"
>   filhdf = "test.regional.hdf"
>   pthhdf = dirhdf+filhdf
>   fhdf   = addfile(pthhdf, "r")
>
>   gbin_hdf = fhdf->GBIN
>   printVarSummary(gbin_hdf)
>   printMinMax(gbin_hdf,0)
>
>   dirnc  = "./"
>   filnc  = "test.regional.nc"
>   pthnc  = dirnc+filnc
>   fnc    = addfile(pthnc, "r")
>   gbin_nc = fnc->GBIN
>   printVarSummary(gbin_nc)
>   printMinMax(gbin_nc,0)
>
> ====================== OUTPUT==============
> Variable: *gbin_hdf*
> Type: float
> Total Size: 422500 bytes
>             105625 values
> Number of Dimensions: 2
> Dimensions and sizes: [lat | 325] x [lon | 325]
> Coordinates:
>             lat: [40..46]
>             lon: [-80..-71]
> Number Of Attributes: 3
>   _FillValue : 9.96921e+36
>   long_name : BINNED_AVERAGE_Optical_Depth_047_grid1km
>   hdf_name : GBIN
> (0) BINNED_AVERAGE_Optical_Depth_047_grid1km : min=0   max=0.595
>
> Variable: *gbin_nc*
> Type: float
> Total Size: 422500 bytes
>             105625 values
> Number of Dimensions: 2
> Dimensions and sizes: [lat | 325] x [lon | 325]
> Coordinates:
>             lat: [40..46]
>             lon: [-80..-71]
> Number Of Attributes: 2
>   _FillValue : 9.96921e+36
>   long_name : BINNED_AVERAGE_Optical_Depth_047_grid1km
> (0) BINNED_AVERAGE_Optical_Depth_047_grid1km : min=0   max=0.595
>
>
>
> On Tue, Dec 17, 2019 at 1:18 PM Herb, Jason via ncl-talk <
> ncl-talk at ucar.edu> wrote:
>
>> Hello,
>>
>> I am attempting a climatology of modis data based on monthly output
>> files. I have montly output netcdf and hdf files from 2002 to 2015. I have
>> tried to single file read (ex the month of Jan 2006 it has only the lat,
>> lon and the monthly averaged aod data "GBIN" ) to display that months
>> average data to make sure the file is being read properly. Unfortunately
>> NCL is not able to read either of the hdf or nc files. I have tried to
>> ncl_filedump on the hdf files and outputs the lat and lon when selected but
>> can not find the GBIN data, however if I run the ncl_filedump on the nc
>> file I can see the full dataset when selected. Any suggestions as to how i
>> can feed this data in to a script so NCL can understand to process.
>>
>> Thanks,
>> Jason
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> _______________________________________________
> 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/20191217/798cfc3f/attachment.html>


More information about the ncl-talk mailing list