How to load MODIS/Terra+Aqua MAIAC Land Aerosol Optical Depth Daily L2G 1 km SIN Grid (MCD19A2) using Xarray Python

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
kmmrao
Posts: 14
Joined: Wed Dec 29, 2021 1:53 am America/New_York
Answers: 0

How to load MODIS/Terra+Aqua MAIAC Land Aerosol Optical Depth Daily L2G 1 km SIN Grid (MCD19A2) using Xarray Python

by kmmrao » Mon Jan 30, 2023 5:15 am America/New_York

Hi,
I am trying to visualize multiple granules of MODIS/Terra+Aqua MAIAC Land Aerosol Optical Depth Daily L2G 1 km SIN Grid (MCD19A2) using Xarray Python. But it is making an error. Is there any tutorial in reading multiple files of MCD19A2 in python using xarray or another library?
Attachments
Reading Multiple files error
Reading Multiple files error
Screenshot (215).png (45.61 KiB) Not viewed yet

Filters:

LP DAAC - dgolon
User Services
User Services
Posts: 329
Joined: Mon Sep 30, 2019 10:00 am America/New_York
Answers: 0
Has thanked: 24 times
Been thanked: 4 times
Contact:

Re: How to load MODIS/Terra+Aqua MAIAC Land Aerosol Optical Depth Daily L2G 1 km SIN Grid (MCD19A2) using Xarray Python

by LP DAAC - dgolon » Tue Feb 14, 2023 4:21 pm America/New_York

Hello, we have passed your question along to our developers and will write back when we have an answer. Thank you.
Subscribe to the LP DAAC listserv by sending a blank email to lpdaac-join@lists.nasa.gov.

Sign up for the Landsat listserv to receive the most up to date information about Landsat data: https://public.govdelivery.com/accounts/USDOIGS/subscriber/new#tab1.

LP DAAC - lien
User Services
User Services
Posts: 187
Joined: Thu Jun 25, 2020 9:51 am America/New_York
Answers: 1
Been thanked: 6 times

Re: How to load MODIS/Terra+Aqua MAIAC Land Aerosol Optical Depth Daily L2G 1 km SIN Grid (MCD19A2) using Xarray Python

by LP DAAC - lien » Tue Feb 28, 2023 3:55 pm America/New_York

Hello
Unfortunately, we do not have a tutorial for working with MCD19A2 data currently. But you can try the code below. make sure you are using the correct group for this dataset. For this dataset "grid1km" and "grid5km" are valid inputs for "group". you can also choose a "variable" if you are only interested in one variable. for example add
"variable = 'Optical_Depth_047'" to the parameters inside the parenthesis. You will be able to visualize the data using "hvplot" library.


xarray.open_mfdataset('*.hdf', engine= 'rasterio', combine= 'nested', group='grid1km')
Thanks,
LPDAAC

Post Reply