Plot aerosol feature subtypes

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
Posts: 1
Joined: Mon Jan 08, 2024 7:26 am America/New_York
Answers: 0

Plot aerosol feature subtypes

by satyaprakash » Mon Jan 08, 2024 7:30 am America/New_York

I am trying to plot the contours of aerosol feature subtypes (dust, polluted dust, smoke etc.) with the help of CALIPSO Vertical feature mask (CAL_LID_L2_VFM-Standard-V4-51.2015-05-31T07-59-22ZD_Subset product) using python. I have referred to examples from but I am not able to plot it. Can anyone help me with the script to plot the aerosol feature subtype contours with respect to latitude and altitude?
WhatsApp Image 2024-01-08 at 17.56.15_b34c3231.jpg
WhatsApp Image 2024-01-08 at 17.56.15_b34c3231.jpg (33.71 KiB) Not viewed yet


Posts: 6
Joined: Tue Jan 09, 2024 2:16 am America/New_York
Answers: 0

Re: Plot aerosol feature subtypes

by sidsaini445 » Tue Jan 09, 2024 9:46 am America/New_York

Here is some sample Python code to plot the contours of aerosol subtypes from the CALIPSO Vertical Feature Mask (VFM) product with respect to latitude and altitude:

[code]import numpy as np
import matplotlib.pyplot as plt
from pyhdf.SD import SD, SDC

# Open the HDF4 file
FILE_NAME = 'CAL_LID_L2_VFM-Standard-V4-51.2015-05-31T07-59-22ZD_Subset.hdf'

# Extract the feature classification data
data3D ='Feature_Classification_Flags')[:,:].astype(int)

# Get the latitude and altitude arrays
latitude ='Latitude')[:,0]
altitude ='Altitude')[:,0]

# Create a plot
fig, ax = plt.subplots()

# Contourf plot for dust (class 3)
cs = ax.contourf(latitude, altitude, (data3D==3).astype(int), levels=[0,.5,1], cmap='Reds')

# Contourf plot for smoke (class 4)
cs = ax.contourf(latitude, altitude, (data3D==4).astype(int), levels=[0,.5,1], cmap='Greens')

ax.set_ylabel('Altitude (km)')
ax.set_xlabel('Latitude (degrees)')

plt.title('CALIPSO Aerosol Subtypes')

This plots filled contour plots showing the detected pixels of dust (red) and smoke (green) as a function of latitude and altitude from the CALIPSO data. Additional subtype classes could be added following the same contourf plotting approach.
Please let me know if you have any other questions!

Sid Saini
Last edited by ASDC - David W. on Tue Jan 09, 2024 2:13 pm America/New_York, edited 1 time in total.
Reason: removing website advertising link

Post Reply