Download MODIS Products using Python (modis-tools package)

131 Views Asked by At

I wanted to download a modis product using python, e.g. MOD13A2 v061, from the earth data catalog: https://lpdaac.usgs.gov/product_search/

I did a search for libraries suitable for downloading this type of product under python, I found the "Pymodis" and "Modis-tools" package. I tested this last one (the most recent), the download is done correctly according to the command lines proposed by the administrators of this package: https://pypi.org/project/modis-tools/

However, the cutting area is not done correctly. I assigned a WGS 84 coordinate system with this format [x1,y1,x2,y2]. Indeed, the extent of the downloaded layers is much larger compared to the desired extent.

 from modis_tools.auth import ModisSession
    from modis_tools.resources import CollectionApi, GranuleApi
    from modis_tools.granule_handler import GranuleHandler
    
    username = ""  # Update this line
    password = ""  # Update this line
    
    # Authenticate a session
    session = ModisSession(username=username, password=password)
    
    # Query the MODIS catalog for collections

collection_client = CollectionApi(session=session)
collections = collection_client.query(short_name="MOD13A2", version="061")

# Query the selected collection for granules
granule_client = GranuleApi.from_collection(collections[0], session=session)

# Filter the selected granules via spatial and temporal parameters
bbox = [8.06,47.88,9.97,50.02]
bbox_granules = granule_client.query(start_date="2001-01-01", end_date="2001-03-01", bounding_box=bbox)

# Download the granules
GranuleHandler.download_from_granules(bbox_granules, session)

I checked the original coordinate system used for these MODIS products, it is: "Sinusoidal". This information is not cited in the modis tools package manual, did you know what this is the problem ? Is there anyone who has been able to use this package to download this type of product? I can't find any discussions about this package!!

Otherwise, are there other ways under Python (other packages) that allow us to download this type of product correctly and easily?

Thank you in advance for your discussions,

Sincerely,

0

There are 0 best solutions below