[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #GKE-356296]: HDF_TO_NETCDF



Hi Kunal,

I do not have the NCL tools installed; can you provide the .nc file
generated by your python script? I will then work with the python script
portions which interact with the resultant netCDF file and see if I can
figure out what is wrong.

Thanks!

-Ward

address@hidden> wrote:

> New Client Reply: HDF_TO_NETCDF
>
> please find the test file and python script in the attachment.
>
> The code for converting hdf to netcdf and extracting LST variable is used
> as
>
> python test_data.py filename.hdf variable_name ./ ./
>
> python test_data.py MOD11_L2......   LST  ./ ./
>
> Kunal Bali
> Research Scholar
> Radio & Atmospheric Science Division
> CSIR - National Physical Laboratory
> New Delhi - 110012
> India
>
>
>
>
>
> address@hidden> wrote:
>
> > Hello Kunal,
> >
> > Thank you for trying that.  To clarify, you are only seeing one error,
> and
> > several warnings.  If you want to quiet the warnings about unsupported
> data
> > types, you will need to change the output data format from
> NETCDF3_CLASSIC
> > to a different type that supports the variable types you are using, such
> as
> > netCDF4.
> >
> > Would it be possible to get the test file you are working with as well as
> > the latest version of the python script? I will see if I can figure out
> > what is going on, or will pass the question along to one of our python
> > experts.
> >
> > Thank you!
> >
> > -Ward
> >
> >
> > > Still, I am getting that errors
> > >
> > > Classic mode NetCDf does not support unsigned integer types: LST will
> be
> > > written as type short
> > > Classic mode NetCDf does not support unsigned integer types: QC will be
> > > written as type short
> > > Classic mode NetCDf does not support unsigned integer types: Error_LST
> > will
> > > be written as type byte
> > > Classic mode NetCDf does not support unsigned integer types: Emis_31
> will
> > > be written as type byte
> > > Classic mode NetCDf does not support unsigned integer types: Emis_32
> will
> > > be written as type byte
> > > Classic mode NetCDf does not support unsigned integer types: View_angle
> > > will be written as type byte
> > > Classic mode NetCDf does not support unsigned integer types: View_time
> > will
> > > be written as type byte
> > > Traceback (most recent call last):
> > > File "/home/kunal/mishra_sir/test_data_aod.py", line 88, in <module>
> > > lonin = ncfile.variables['longitude'][:]
> > > KeyError: 'longitude'
> > >
> > >
> > > Regards
> > > Kunal Bali
> > >
> > >
> > >
> > >
> > >
> > > address@hidden> wrote:
> > >
> > > > Hi Kunal,
> > > >
> > > > Thank you! It appears that the dictionary key in python should be
> > > > 'longitude' instead of 'Longitude'.  Can you try that and see if it
> > works?
> > > >
> > > > Thanks!
> > > >
> > > > -Ward
> > > >
> > > > On Thu, Jul 27, 2017 at 9:53 AM, Kunal Bali
> > <address@hidden.
> > > > edu
> > > > > wrote:
> > > >
> > > > > New Client Reply: HDF_TO_NETCDF
> > > > >
> > > > > kunal@kunal-Vostro-1015:~/data$ ncdump -h
> > > > > MOD11_L2.A2003090.0450.006.2015187194709.nc
> > > > > netcdf MOD11_L2.A2003090.0450.006.2015187194709 {
> > > > > dimensions:
> > > > >     time = 1 ;
> > > > >     lon = 1354 ;
> > > > >     lat = 2030 ;
> > > > >     nv = 4 ;
> > > > > variables:
> > > > >     double time(time) ;
> > > > >         time:units = "hours since 0001-01-01 00:00:00.0" ;
> > > > >         time:calendar = "gregorian" ;
> > > > >     double latitude(lat, lon) ;
> > > > >         latitude:units = "degrees_north" ;
> > > > >         latitude:bounds = "lat_bnds" ;
> > > > >     double longitude(lat, lon) ;
> > > > >         longitude:units = "degrees_east" ;
> > > > >         longitude:bounds = "lon_bnds" ;
> > > > >     double lat_bnds(lat, lon, nv) ;
> > > > >     double lon_bnds(lat, lon, nv) ;
> > > > >     double LST(time, lat, lon) ;
> > > > >         LST:units = "" ;
> > > > >         LST:long_name = "Fraction of AOT contributed by fine
> > dominated
> > > > > model" ;
> > > > >         LST:coordinates = "latitude longitude" ;
> > > > >         LST:fillvalue = "-9.e+33" ;
> > > > >         LST:missing_value = -9.e+33 ;
> > > > >
> > > > > // global attributes:
> > > > >         :description = "Read MODIS Terra data" ;
> > > > >         :source = "NPL-Kunal Bali" ;
> > > > > }
> > > > >
> > > > >
> > > > > Kunal Bali
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > address@hidden> wrote:
> > > > >
> > > > > > Hello,
> > > > > >
> > > > > > Can you please run ncdump -h and send the output? Thank you,
> > > > > >
> > > > > > -Ward
> > > > > >
> > > > > > Sent from my iPhone
> > > > > >
> > > > > > > On Jul 27, 2017, at 12:28 AM, Kunal Bali
> > > > <address@hidden.
> > > > > > edu> wrote:
> > > > > > >
> > > > > > > New Client Reply: HDF_TO_NETCDF
> > > > > > >
> > > > > > > Hello Sir/Ma'am
> > > > > > >
> > > > > > > ncdump shows that its a classic netcdf format. (ncdump -k
> > input.nc)
> > > > > > >
> > > > > > > the given script is converting hdf to netcdf but while
> > converting hdf
> > > > > > file
> > > > > > > to netcdf its not reading the dimension properly thst why i am
> > > > getting
> > > > > > the
> > > > > > > error
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Kunal Bali
> > > > > > > Research Scholar
> > > > > > > Radio & Atmospheric Science Division
> > > > > > > CSIR - National Physical Laboratory
> > > > > > > New Delhi - 110012
> > > > > > > India
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > address@hidden> wrote:
> > > > > > >
> > > > > > >> Hi Kunal,
> > > > > > >>
> > > > > > >> The next step will be to examine the metadata of the sample
> > NetCDF
> > > > > file
> > > > > > >> you are using. With NetCDF installed on your system, you
> should
> > have
> > > > > the
> > > > > > >> 'ncdump' utility available.
> > > > > > >>
> > > > > > >> Can you run `ncdump -h [filename]` on the netCDF file you are
> > > > working
> > > > > > >> with, and send me the output? This command will print the
> > metadata
> > > > for
> > > > > > the
> > > > > > >> contents of the file. I can use this to try to figure out why
> > your
> > > > > > python
> > > > > > >> script isn't working.
> > > > > > >>
> > > > > > >> Thank you,
> > > > > > >>
> > > > > > >> -Ward
> > > > > > >>
> > > > > > >>
> > > > > > >>> On Jul 26, 2017, at 10:11 PM, Kunal Bali
> > > > > <address@hidden.
> > > > > > >> edu> wrote:
> > > > > > >>>
> > > > > > >>> New Client Reply: HDF_TO_NETCDF
> > > > > > >>>
> > > > > > >>> DearSir/Ma'am
> > > > > > >>>
> > > > > > >>> I am converting hdf to netcdf using python script with NCL.
> It
> > is
> > > > > > working
> > > > > > >>> well with MODIS Terra Level-2 aeroosl and cloud hdf files but
> > not
> > > > > > working
> > > > > > >>> with Land surface Temperature file (hdf Level-2), so I am not
> > > > getting
> > > > > > any
> > > > > > >>> netcdf as output file.
> > > > > > >>>
> > > > > > >>> I can send you pythin script (which I am using for converting
> > hdf
> > > > to
> > > > > > >>> netcdf) if you want to see any error?
> > > > > > >>>
> > > > > > >>>
> > > > > > >>>
> > > > > > >>> Kunal Bali
> > > > > > >>> Research Scholar
> > > > > > >>> Radio & Atmospheric Science Division
> > > > > > >>> CSIR - National Physical Laboratory
> > > > > > >>> New Delhi - 110012
> > > > > > >>> India
> > > > > > >>>
> > > > > > >>>
> > > > > > >>>
> > > > > > >>>
> > > > > > >>>
> > > > > > >>> address@hidden> wrote:
> > > > > > >>>
> > > > > > >>>> Hello Kunal,
> > > > > > >>>>
> > > > > > >>>> Can you run `ncdump -h [filename]` on the netCDF file you
> are
> > > > > working
> > > > > > >>>> with, and send me the output? This command will print the
> > metadata
> > > > > for
> > > > > > >> the
> > > > > > >>>> contents of the file.
> > > > > > >>>>
> > > > > > >>>> Thank you,
> > > > > > >>>>
> > > > > > >>>> -Ward
> > > > > > >>>>
> > > > > > >>>>> The file has both the latitude and longitude variables.
> > > > > > >>>>>
> > > > > > >>>>> please see the attached picture regarding the file
> variables
> > > > > > >>>>>
> > > > > > >>>>> Kunal Bali
> > > > > > >>>>> Research Scholar
> > > > > > >>>>> Radio & Atmospheric Science Division
> > > > > > >>>>> CSIR - National Physical Laboratory
> > > > > > >>>>> New Delhi - 110012
> > > > > > >>>>> India
> > > > > > >>>>>
> > > > > > >>>>>
> > > > > > >>>>>
> > > > > > >>>>>
> > > > > > >>>>>
> > > > > > >>>>> address@hidden> wrote:
> > > > > > >>>>>
> > > > > > >>>>>> Hello,
> > > > > > >>>>>>
> > > > > > >>>>>> The warnings you are getting relate to unsupported data
> > types
> > > > for
> > > > > > the
> > > > > > >>>>>> netCDF file, and seem fairly straight-forward.  Because
> > > > variables
> > > > > in
> > > > > > >>>> the
> > > > > > >>>>>> HDF file are of types that are unsupported in netCDF, they
> > are
> > > > > being
> > > > > > >>>>>> converted to a different, supported data type.  Regarding
> > the
> > > > > python
> > > > > > >>>> error,
> > > > > > >>>>>> it appears that the ncfile.variables dictionary doesn't
> > contain
> > > > a
> > > > > > >>>>>> 'Longitude' value.  Are you certain that the file you are
> > > > working
> > > > > > with
> > > > > > >>>>>> contains a Longitude variable?
> > > > > > >>>>>>
> > > > > > >>>>>> Thank you,
> > > > > > >>>>>>
> > > > > > >>>>>> -Ward
> > > > > > >>>>>>
> > > > > > >>>>>>> DEar Sir/Ma'am
> > > > > > >>>>>>>
> > > > > > >>>>>>> I am using NCL with python script for converting
> > MODIS-Terra
> > > > > > Level-2
> > > > > > >>>> hdf
> > > > > > >>>>>>> file into netcdf. The script is working properly for
> > accessing
> > > > L2
> > > > > > >>>> AOD and
> > > > > > >>>>>>> Clouds product but It's not working with the land surface
> > data
> > > > > file
> > > > > > >>>> (L3
> > > > > > >>>>>>> 0.05 km CMG) (MOD11C1.A2003060.006.2015184042221.hdf).
> > > > > > >>>>>>>
> > > > > > >>>>>>> I am getting following errors such as
> > > > > > >>>>>>>
> > > > > > >>>>>>> Classic mode NetCDf does not support unsigned integer
> > types:
> > > > > > >>>> LST_Day_CMG
> > > > > > >>>>>>> will be written as type short
> > > > > > >>>>>>> Classic mode NetCDf does not support unsigned integer
> > types:
> > > > > QC_Day
> > > > > > >>>> will
> > > > > > >>>>>> be
> > > > > > >>>>>>> written as type byte
> > > > > > >>>>>>> Classic mode NetCDf does not support unsigned integer
> > types:
> > > > > > >>>>>> Day_view_time
> > > > > > >>>>>>> will be written as type byte
> > > > > > >>>>>>> Classic mode NetCDf does not support unsigned integer
> > types:
> > > > > > >>>>>> Day_view_angl
> > > > > > >>>>>>> will be written as type byte
> > > > > > >>>>>>> Classic mode NetCDf does not support unsigned integer
> > types:
> > > > > > >>>>>> LST_Night_CMG
> > > > > > >>>>>>> will be written as type short
> > > > > > >>>>>>> Classic mode NetCDf does not support unsigned integer
> > types:
> > > > > > QC_Night
> > > > > > >>>>>> will
> > > > > > >>>>>>> be written as type byte
> > > > > > >>>>>>>
> > > > > > >>>>>>> And
> > > > > > >>>>>>>
> > > > > > >>>>>>> Traceback (most recent call last):
> > > > > > >>>>>>> File "/home/kunal/mishra_sir/test_data_st.py", line 88,
> in
> > > > > > <module>
> > > > > > >>>>>>> lonin = ncfile.variables['Longitude'][:]
> > > > > > >>>>>>> KeyError: 'Longitude'
> > > > > > >>>>>>>
> > > > > > >>>>>>> Could you please let me know how can I solve it?
> > > > > > >>>>>>> PLEASE FIND THE ATTACHED PHYTON SCRIPT.
> > > > > > >>>>>>>
> > > > > > >>>>>>>
> > > > > > >>>>>>>
> > > > > > >>>>>>> Regards
> > > > > > >>>>>>> Kunal Bali
> > > > > > >>>>>>>
> > > > > > >>>>>>>
> > > > > > >>>>>>
> > > > > > >>>>>>
> > > > > > >>>>>> Ticket Details
> > > > > > >>>>>> ===================
> > > > > > >>>>>> Ticket ID: GKE-356296
> > > > > > >>>>>> Department: Support netCDF
> > > > > > >>>>>> Priority: Normal
> > > > > > >>>>>> Status: Closed
> > > > > > >>>>>> ===================
> > > > > > >>>>>> NOTE: All email exchanges with Unidata User Support are
> > recorded
> > > > > in
> > > > > > >> the
> > > > > > >>>>>> Unidata inquiry tracking system and then made publicly
> > available
> > > > > > >>>> through
> > > > > > >>>>>> the web.  If you do not want to have your interactions
> made
> > > > > > available
> > > > > > >>>> in
> > > > > > >>>>>> this way, you must let us know in each email you send to
> us.
> > > > > > >>>>>>
> > > > > > >>>>>>
> > > > > > >>>>>>
> > > > > > >>>>>
> > > > > > >>>>>
> > > > > > >>>>
> > > > > > >>>>
> > > > > > >>>> Ticket Details
> > > > > > >>>> ===================
> > > > > > >>>> Ticket ID: GKE-356296
> > > > > > >>>> Department: Support netCDF
> > > > > > >>>> Priority: Normal
> > > > > > >>>> Status: Closed
> > > > > > >>>> ===================
> > > > > > >>>> NOTE: All email exchanges with Unidata User Support are
> > recorded
> > > > in
> > > > > > the
> > > > > > >>>> Unidata inquiry tracking system and then made publicly
> > available
> > > > > > through
> > > > > > >>>> the web.  If you do not want to have your interactions made
> > > > > available
> > > > > > in
> > > > > > >>>> this way, you must let us know in each email you send to us.
> > > > > > >>>>
> > > > > > >>>>
> > > > > > >>>>
> > > > > > >>>
> > > > > > >>>
> > > > > > >>>
> > > > > > >>> Ticket Details
> > > > > > >>> ===================
> > > > > > >>> Ticket ID: GKE-356296
> > > > > > >>> Department: Support netCDF
> > > > > > >>> Priority: Normal
> > > > > > >>> Status: Open
> > > > > > >>> Link:  https://andy.unidata.ucar.edu/
> > esupport/staff/index.php?_m=
> > > > > > >> tickets&_a=viewticket&ticketid=28507
> > > > > > >>>
> > > > > > >>
> > > > > > >>
> > > > > > >>
> > > > > > >> Ticket Details
> > > > > > >> ===================
> > > > > > >> Ticket ID: GKE-356296
> > > > > > >> Department: Support netCDF
> > > > > > >> Priority: Normal
> > > > > > >> Status: Open
> > > > > > >> ===================
> > > > > > >> NOTE: All email exchanges with Unidata User Support are
> > recorded in
> > > > > the
> > > > > > >> Unidata inquiry tracking system and then made publicly
> available
> > > > > through
> > > > > > >> the web.  If you do not want to have your interactions made
> > > > available
> > > > > in
> > > > > > >> this way, you must let us know in each email you send to us.
> > > > > > >>
> > > > > > >>
> > > > > > >>
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Ticket Details
> > > > > > > ===================
> > > > > > > Ticket ID: GKE-356296
> > > > > > > Department: Support netCDF
> > > > > > > Priority: Normal
> > > > > > > Status: Open
> > > > > > > Link:  https://andy.unidata.ucar.edu/
> > esupport/staff/index.php?_m=
> > > > > > tickets&_a=viewticket&ticketid=28507
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > Ticket Details
> > > > > > ===================
> > > > > > Ticket ID: GKE-356296
> > > > > > Department: Support netCDF
> > > > > > Priority: Normal
> > > > > > Status: Open
> > > > > > ===================
> > > > > > NOTE: All email exchanges with Unidata User Support are recorded
> > in the
> > > > > > Unidata inquiry tracking system and then made publicly available
> > > > through
> > > > > > the web.  If you do not want to have your interactions made
> > available
> > > > in
> > > > > > this way, you must let us know in each email you send to us.
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > Ticket Details
> > > > > ===================
> > > > > Ticket ID: GKE-356296
> > > > > Department: Support netCDF
> > > > > Priority: Normal
> > > > > Status: Open
> > > > > Link:  https://andy.unidata.ucar.edu/esupport/staff/index.php?_m=
> > > > > tickets&_a=viewticket&ticketid=28507
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > Ticket Details
> > > > ===================
> > > > Ticket ID: GKE-356296
> > > > Department: Support netCDF
> > > > Priority: Normal
> > > > Status: Open
> > > > ===================
> > > > NOTE: All email exchanges with Unidata User Support are recorded in
> the
> > > > Unidata inquiry tracking system and then made publicly available
> > through
> > > > the web.  If you do not want to have your interactions made available
> > in
> > > > this way, you must let us know in each email you send to us.
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
> > Ticket Details
> > ===================
> > Ticket ID: GKE-356296
> > Department: Support netCDF
> > Priority: Normal
> > Status: Closed
> > ===================
> > NOTE: All email exchanges with Unidata User Support are recorded in the
> > Unidata inquiry tracking system and then made publicly available through
> > the web.  If you do not want to have your interactions made available in
> > this way, you must let us know in each email you send to us.
> >
> >
> >
>
>
>
> Ticket Details
> ===================
> Ticket ID: GKE-356296
> Department: Support netCDF
> Priority: Normal
> Status: Open
> Link:  https://andy.unidata.ucar.edu/esupport/staff/index.php?_m=
> tickets&_a=viewticket&ticketid=28507
>



Ticket Details
===================
Ticket ID: GKE-356296
Department: Support netCDF
Priority: Normal
Status: Open
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.