Reprojecting Modis data using python

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
arnabp893
Posts: 14
Joined: Tue Jun 21, 2022 1:35 pm America/New_York

Reprojecting Modis data using python

by arnabp893 » Tue Aug 16, 2022 2:51 pm America/New_York

Hello everyone,
I want to reproject/georeference multiple Modis L2 (single variable, such as chl_a) data in a folder using python. any code or guidance will be helpful.

Tags:

gnwiii
Posts: 670
Joined: Fri Jan 29, 2021 5:51 pm America/New_York
Answers: 2

Re: Reprojecting Modis data using python

by gnwiii » Wed Aug 17, 2022 10:54 am America/New_York

ESA SNAP snappy uses the jpy java-python bridge and can map MODIS level-2 files, but the mapped data will be a Java object so there is consierable overhead if you want the mapped data in Python.

For native Python with MODIS data: https://python-geotiepoints.readthedocs.io/en/latest/#example-aqua-terra-modis-data

arnabp893
Posts: 14
Joined: Tue Jun 21, 2022 1:35 pm America/New_York

Re: Reprojecting Modis data using python

by arnabp893 » Wed Aug 17, 2022 1:15 pm America/New_York

Thank you for the reply.

I am probably gonna do them manually in seadas. In that case, which format will be useful to save the reprojected data?
There are multiple options such as netcdf-cf, netcdf BEAM etc. which one will be easily readable by python?

gnwiii
Posts: 670
Joined: Fri Jan 29, 2021 5:51 pm America/New_York
Answers: 2

Re: Reprojecting Modis data using python

by gnwiii » Wed Aug 17, 2022 2:08 pm America/New_York

NetCDF4-CF has good metadata support and supports internal compression. BEAM DIMAP is useful as an intermediate format when subsequent processing will be done using SNAP or SeaDAS 8, but is not as well supported by 3rd party software and does not support internal compression. Modern CPU's do internal compression with very low impact on most workflows, and significant space savings which is often useful (in large organizations, using compression saves time filling out requests for increased disk space and then waiting for the next tranch of funds).

OB.DAAC - SeanBailey
User Services
User Services
Posts: 1315
Joined: Wed Sep 18, 2019 6:15 pm America/New_York
Answers: 1
Been thanked: 1 time

Re: Reprojecting Modis data using python

by OB.DAAC - SeanBailey » Wed Aug 17, 2022 2:26 pm America/New_York

If you are not rigid on requiring python to do the reprojection (and assuming you are interested in the L2 data from the OB.DAAC), the processing code available with SeaDAS includes several programs that can be tied together to generate mapped outputs. The workflow is to bin the L2 data to L3, then map the L3 to your favorite projection. ...and there is a wrapper script (written in python - cleverly called mapgen) that puts it all together.

Sean

sym_knull
Posts: 1
Joined: Fri Aug 19, 2022 2:57 am America/New_York

Re: Reprojecting Modis data using python

by sym_knull » Fri Aug 19, 2022 2:58 am America/New_York

Thank You very much!!

Post Reply