Page 1 of 1

Reprojecting Modis data using python

Posted: Tue Aug 16, 2022 2:51 pm America/New_York
by arnabp893
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.

Re: Reprojecting Modis data using python

Posted: Wed Aug 17, 2022 10:54 am America/New_York
by gnwiii
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

Re: Reprojecting Modis data using python

Posted: Wed Aug 17, 2022 1:15 pm America/New_York
by arnabp893
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?

Re: Reprojecting Modis data using python

Posted: Wed Aug 17, 2022 2:08 pm America/New_York
by gnwiii
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).

Re: Reprojecting Modis data using python

Posted: Wed Aug 17, 2022 2:26 pm America/New_York
by OB.DAAC - SeanBailey
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

Re: Reprojecting Modis data using python

Posted: Fri Aug 19, 2022 2:58 am America/New_York
by sym_knull
Thank You very much!!