Python script to read and visualize HDF CALIPSO files

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
benhurmp
Posts: 8
Joined: Thu Oct 08, 2020 3:58 pm America/New_York
Answers: 0

Python script to read and visualize HDF CALIPSO files

by benhurmp » Thu Feb 25, 2021 3:48 pm America/New_York

Hello everyone,

I'm trying to open CALIPSO hdf files and analyze the Vertical Feature Mask of them, and to do this I want to plot (via Python) a vertical profile of the data (with the Feature Type flags). I found the Compreensive Examples site:

https://www.hdfeos.org/zoo/index_openLaRC_Examples.php

But with the python scripts from there I can only plot the vertical profile of a single Feature Type, and it's a little bit confuse (I am studying to understand beter the data and how to handle with them) to adapt to what I need.

How can I make a full vertical Feature Type plot? I'm trying to do it, but it has been difficult. Thank you very much!

(OBS.: Here is an example of hdf file I'm using: CAL_LID_L2_VFM-Standard-V4-20.2006-06-13T04-54-47ZN.hdf)

Tags:

ASDC - rbeck
Posts: 17
Joined: Tue Nov 19, 2019 11:41 am America/New_York
Answers: 0

Re: Python script to read and visualize HDF CALIPSO files

by ASDC - rbeck » Fri Feb 26, 2021 11:14 am America/New_York

Dear Ben-hur Martins,

Thank you for your interest in HDF CALIPSO files. I have reached out to our CALIPSO SME. We should have an answer for you soon.

ASDC - rbeck
Posts: 17
Joined: Tue Nov 19, 2019 11:41 am America/New_York
Answers: 0

Re: Python script to read and visualize HDF CALIPSO files

by ASDC - rbeck » Wed Mar 03, 2021 5:03 pm America/New_York

Dear Ben-Hur Martins,

I have received the following information from our subject matter expert:

The sample code at hdfeos.org is tailored to only plot a single feature type; type=2(cloud).

# Extract Feature Type only (1-3 bits) through bitmask.
data = data & 7
……

# Focus on cloud (=2) data only.
data[data > 2] = 0;
data[data < 2] = 0;
data[data == 2] = 1;

Hopefully this information will help you. If you need further assistance please let us know.

ASDC - joseph.f.koch
User Services
User Services
Posts: 33
Joined: Mon Nov 23, 2020 3:57 pm America/New_York
Answers: 2

Re: Python script to read and visualize HDF CALIPSO files

by ASDC - joseph.f.koch » Wed Mar 03, 2021 11:38 pm America/New_York

Hi @benhurmp,

Regarding your question on how to make a full Vertical Feature plot, are you looking for an image of all types plotting as a function of altitude (see example attached)?

If you'd like to connect with us virtually and walk us through what you are hoping to plot we'd be glad to take a look and offer up further assistance. Just let us know if you'd prefer this approach and we can set something up.

In the meantime, here are some additional resources that may assist you in plotting full vertical Feature Types:

VOCAL tool http://nasa-develop.github.io/VOCAL/dev ... index.html

How to Access and Visualize CALIPSO data http://meteothink.org/examples/meteoinf ... lipso.html

The NASA CALIPSO website also offers browse imagery where you can explore multiple images of CALIPSO profile observations https://www-calipso.larc.nasa.gov/produ ... 2020-07-01. This also includes the Vertical Feature Mask (VFM) browse image.

Hope this is helpful.

-Joe
Attachments
2020-01-03_01-12-02_V4.10_3_6.png
2020-01-03_01-12-02_V4.10_3_6.png (85.27 KiB) Not viewed yet

benhurmp
Posts: 8
Joined: Thu Oct 08, 2020 3:58 pm America/New_York
Answers: 0

Re: Python script to read and visualize HDF CALIPSO files

by benhurmp » Thu Mar 04, 2021 9:04 pm America/New_York

Hello @joseph.f.koch,

Your materials are great, and I'm trying to do exactly the kind of plot you attached. In the Meteothink website you sent me there is a script to plot all the Feature Types (the 3rd code), but when I try to run the script, the compiler shows a message saying that there is an inconsistency on line 32 (a ']' missing, perhaps). Can you help me, please?

Thank you! :)

ASDC - joseph.f.koch
User Services
User Services
Posts: 33
Joined: Mon Nov 23, 2020 3:57 pm America/New_York
Answers: 2

Re: Python script to read and visualize HDF CALIPSO files

by ASDC - joseph.f.koch » Mon Mar 08, 2021 1:37 pm America/New_York

Hi @benhurmp,

I have reviewed line 32 and see no inconsistencies or syntax errors, so not sure why the script you are running is not able to execute, especially considering it is the same code that was used to generate the image listed on the Meteothink webpage.

You could try adding a "]" to where it may be missing, but I would recommend reaching out to Yaqiang Wang at yaqiang.wang@gmail.com to see if they can further assist since they wrote and maintain this code and we (ASDC) do not.

Hope this helps.

Thanks,
Joe

Post Reply