How to read CALIPSO level 3 HDF4 file

Please enter here to ask a question about any NASA Science related topics!
Post Reply
meihan
Posts: 3
Joined: Fri May 28, 2021 7:21 am America/New_York

How to read CALIPSO level 3 HDF4 file

by meihan » Fri May 28, 2021 7:36 am America/New_York

Hi,

I am used to read HDF5 file. But I need to read CALIPSO level 3 which is HDF4.
I tried a couple of ways with IDL or Python. It seems neither of them work. It looks like both with the problem to handle the hierarchy of data because the data array I am looking for is not at the first level.

With IDL, I tried:
filename='CAL_LID_L3_GEWEX_Cloud-Standard-V1-00.2015-07A.hdf'
hdfid=hdf_sd_start(filename)
index=hdf_sd_nametoindex(hdfid,'Cloud_Amount_Column/Water_Cloud_Amount_Mean_Column')
varid=hdf_sd_select(hdfid, index)
hdf_sd_getdata, varid, precipitation
hdf_sd_endaccess, varid
hdf_sd_end, hdfid

It ends with an error "HDF_SD_SELECT: Unable to select the HDF-SD dataset (HDFID)"


With Python, I tried:
from pyhdf.SD import SD, SDC
filename = 'CAL_LID_L3_GEWEX_Cloud-Standard-V1-00.2015-01A.hdf'
hdf = SD(filename,SDC.READ)
data = hdf.select('Cloud_Amount_Column/Water_Cloud_Amount_Mean_Column')

It ends with an error "HDF4Error: select: non-existent dataset"

Can anyone help me with this issue?

Thank you!

Tags:

ASDC - cheyenne.e.land
User Services
User Services
Posts: 25
Joined: Mon Mar 22, 2021 3:55 pm America/New_York
Answers: 1

Re: How to read CALIPSO level 3 HDF4 file

by ASDC - cheyenne.e.land » Fri May 28, 2021 3:49 pm America/New_York

Hello

Thank you for your interest in CALIPSO data.

Once you open the file:

from pyhdf.SD import SD, SDC
filename = 'CAL_LID_L3_GEWEX_Cloud-Standard-V1-00.2015-01A.hdf'
hdf = SD(filename,SDC.READ)

It would be helpful to list all the available datasets:

print(hdf.datasets())

‘Cloud_Amount_Column’ is not a dataset but a group of datasets that includes ‘Cloud_Amount_Mean_Column’ (if that’s what you meant) and ‘Water_Cloud_Amount_Mean_Column’

Once you have done that you can define and read each dataset:

CAMC = hdf.select(‘Cloud_Amount_Mean_Column’)
WCAMC = hdf.select(‘Water_Cloud_Amount_Mean_Column’)
CAMCdata = CAMC[:]
WCAMCdata = WCAMC[:]

Hope this helps, let us know if you have any questions.

Warm Regards,



NASA Langley ASDC User Services

*****************************
Earthdata Forum (Science Inquiries): https://forum.earthdata.nasa.gov

User Services (General Inquiries): support-asdc@earthdata.nasa.gov

ASDC Website: https://asdc.larc.nasa.gov

meihan
Posts: 3
Joined: Fri May 28, 2021 7:21 am America/New_York

Re: How to read CALIPSO level 3 HDF4 file

by meihan » Fri May 28, 2021 4:23 pm America/New_York

Thanks a lot for your response!
I definitely could use some help here. So, the SDC.READ already specifies the dataset, not the group.

May I also ask if there is any more organized way to show the contents in the HDF file. The print(hdf.datasets()) can do the job, but I just could not find the variable easily without any format.

Your help is greatly appreciated!

ASDC - cheyenne.e.land
User Services
User Services
Posts: 25
Joined: Mon Mar 22, 2021 3:55 pm America/New_York
Answers: 1

Re: How to read CALIPSO level 3 HDF4 file

by ASDC - cheyenne.e.land » Fri Jun 04, 2021 11:38 am America/New_York

Hello,

My sincere apologies for the delay.

A great way to view HDF files in an organized way is using the applications Panoply or HDFView. More information is provided by the links below.

https://www.giss.nasa.gov/tools/panoply/
https://www.hdfgroup.org/downloads/hdfview/

Please let us know if you have any additional questions.

Warm Regards,



NASA Langley ASDC User Services

*****************************
Earthdata Forum (Science Inquiries): https://forum.earthdata.nasa.gov

User Services (General Inquiries): support-asdc@earthdata.nasa.gov

ASDC Website: https://asdc.larc.nasa.gov

meihan
Posts: 3
Joined: Fri May 28, 2021 7:21 am America/New_York

Re: How to read CALIPSO level 3 HDF4 file

by meihan » Fri Jun 04, 2021 11:48 am America/New_York

Thanks for the information. I will give a try of the two software at a later time. May I ask if the two software could work with level 2 orbital data? The two website pages do not directly show if they could deal with orbital data.

Thanks!

ASDC - cheyenne.e.land
User Services
User Services
Posts: 25
Joined: Mon Mar 22, 2021 3:55 pm America/New_York
Answers: 1

Re: How to read CALIPSO level 3 HDF4 file

by ASDC - cheyenne.e.land » Fri Jun 04, 2021 12:14 pm America/New_York

Hello,

If the orbital data's file format is netCDF or HDF then it should work.

Warm Regards,


NASA Langley ASDC User Services

Post Reply