[ncl-talk] hdf_to_netcdf

Dennis Shea shea at ucar.edu
Wed Aug 8 09:20:01 MDT 2018


Your 'summary.txt' contains:

      double* Scan_Start_Time* ( Cell_Along_Swath_mod04,
Cell_Across_Swath_mod04 )
         valid_range :  (    0, 3155800000 )
         _FillValue :   -999
         long_name :    TAI Time at Start of Scan replicated across the
swath
         units :        Seconds since 1993-1-1 00:00:00.0 0
         scale_factor :    1
         add_offset :      0
         Parameter_Type :       MODIS Input
         Cell_Along_Swath_Sampling :    ( 1, 2021, 10 )
         Cell_Across_Swath_Sampling :   ( 1, 1345, 10 )
         Geolocation_Pointer :  Internal geolocation arrays
         hdf_name :     Scan_Start_Time

This 'time' and it is *two-dimensional*.

-----

The 'time' you are trying to create is *one-dimensional *and is based
strictly on a file name.

----
Also, the following may be if interest

https://www.ncl.ucar.edu/Applications/HDF.shtml
hdf4sds_5.ncl <https://www.ncl.ucar.edu/Applications/Scripts/hdf4sds_5.ncl>

---
These files are HDF-EOS format:

*HDFEOSVersion : HDFEOS_V2.19*
For fun, append a *.he2* file extension:

%>* ncl_filedump *MOD04_L2.A2017202.0705.061.2017316182248.hdf*.he2* | less

It makes the file look like a netCDF file dump.


On Wed, Aug 8, 2018 at 3:50 AM, Kunal Bali <kunal.bali9 at gmail.com> wrote:

> Dear NCL user,
>
> I am converting hdf to netcdf using attached ncl script (extracting
> aerosol product). But it's showing some errors and values are also coming
> from +01. to -0.1.
> Summary of the file is also attached herewith.
>
>
> the errors/warning are:
>
> warning:File ./MOD04_L2.A2017209.0710.061.2017317003637.hdf dimension
> sizes do not conform to others in list; skipping file
> warning:File ./MOD04_L2.A2017209.0525.061.2017317002757.hdf dimension
> sizes do not conform to others in list; skipping file
> warning:File ./MOD04_L2.A2017205.0550.061.2017316194801.hdf dimension
> sizes do not conform to others in list; skipping file
> warning:File ./MOD04_L2.A2017200.0355.061.2017316192232.hdf dimension
> sizes do not conform to others in list; skipping file
> warning:File ./MOD04_L2.A2017196.0600.061.2017316164649.hdf dimension
> sizes do not conform to others in list; skipping file
> warning:File ./MOD04_L2.A2017195.0340.061.2017316165535.hdf dimension
> sizes do not conform to others in list; skipping file
> warning:File ./MOD04_L2.A2017192.0625.061.2017316024320.hdf dimension
> sizes do not conform to others in list; skipping file
> warning:File ./MOD04_L2.A2017191.0405.061.2017316013818.hdf dimension
> sizes do not conform to others in list; skipping file
> warning:File ./MOD04_L2.A2017188.0645.061.2017316002323.hdf dimension
> sizes do not conform to others in list; skipping file
> warning:File ./MOD04_L2.A2017187.0610.061.2017315234444.hdf dimension
> sizes do not conform to others in list; skipping file
> warning:File ./MOD04_L2.A2017187.0425.061.2017315234452.hdf dimension
> sizes do not conform to others in list; skipping file
> warning:File ./MOD04_L2.A2017184.0710.061.2017315214958.hdf dimension
> sizes do not conform to others in list; skipping file
> warning:File ./MOD04_L2.A2017183.0450.061.2017315215216.hdf dimension
> sizes do not conform to others in list; skipping file
> warning:A valid instance of variable Deep_Blue_Aerosol_Optical_Depth_550_Land_mod04
> was not found in one or more elements of the file list
> fatal:Coordinate variables must be the same dimension as their dimension
> fatal:No coordinate variable exists for dimension (time) in variable (var)
> fatal:["Execute.c":8640]:Execute: Error occurred at or near line 35 in
> file script_01.ncl
>
> fatal:["Execute.c":8640]:Execute: Error occurred at or near line 69 in
> file script_01.ncl
>
>
> Variable: od55_1km
> Type: short
> Total Size: 6303150 bytes
>             3151575 values
> Number of Dimensions: 3
> Dimensions and sizes:    [time | 115] x [Cell_Along_Swath_mod04 | 203] x
> [Cell_Across_Swath_mod04 | 135]
> Coordinates:
> Number Of Attributes: 12
>   coordinates :    Latitude_mod04, Longitude_mod04
>   hdfeos_name :    Deep_Blue_Aerosol_Optical_Depth_550_Land
>   _FillValue :    -9999
>   Geolocation_Pointer :    Internal geolocation arrays
>   Cell_Across_Swath_Sampling :    ( 1, 1354, 10 )
>   Cell_Along_Swath_Sampling :    ( 1, 2021, 10 )
>   Parameter_Type :    Output
>   add_offset :       0
>   scale_factor :    0.001000000047497451
>   units :    None
>   long_name :    AOT at 0.55 micron for land  with all quality data
> (Quality flag=1,2,3)
>   valid_range :    ( 0, 5000 )
> fatal:Dimension sizes of left hand side do not match right hand side
> fatal:["Execute.c":8640]:Execute: Error occurred at or near line 110 in
> file script_01.ncl
>
>
>
> could you please provide some information on this.
>
> Thank You
>
>
> ---
> Kunal Bali
>
>
>
>
>> [image: Mailtrack]
> <https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality1&> Sent
> with Mailtrack
> <https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality1&>
>
> _______________________________________________
> 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/20180808/3a96edb0/attachment.html>


More information about the ncl-talk mailing list