How to read CALIPSO level 3 HDF4 file
How to read CALIPSO level 3 HDF4 file
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!
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!
Filters:
-
- Subject Matter Expert
- Posts: 165
- Joined: Mon Mar 22, 2021 3:55 pm America/New_York
- Has thanked: 1 time
- Been thanked: 11 times
Re: How to read CALIPSO level 3 HDF4 file
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
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
Re: How to read CALIPSO level 3 HDF4 file
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!
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!
-
- Subject Matter Expert
- Posts: 165
- Joined: Mon Mar 22, 2021 3:55 pm America/New_York
- Has thanked: 1 time
- Been thanked: 11 times
Re: How to read CALIPSO level 3 HDF4 file
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
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
Re: How to read CALIPSO level 3 HDF4 file
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!
Thanks!
-
- Subject Matter Expert
- Posts: 165
- Joined: Mon Mar 22, 2021 3:55 pm America/New_York
- Has thanked: 1 time
- Been thanked: 11 times
Re: How to read CALIPSO level 3 HDF4 file
Hello,
If the orbital data's file format is netCDF or HDF then it should work.
Warm Regards,
NASA Langley ASDC User Services
If the orbital data's file format is netCDF or HDF then it should work.
Warm Regards,
NASA Langley ASDC User Services