fraymio / modis-tools

Tools for working with the MODIS API and MODIS data.
Apache License 2.0
22 stars 11 forks source link

Downloading empty files #23

Closed kejid closed 1 year ago

kejid commented 1 year ago

Describe the bug When I'm trying to download mod13q1 data for India region, receiving empty files.

To Reproduce Steps to reproduce the behavior:

collection_client = CollectionApi(session=session)
collections = collection_client.query(short_name="MOD13Q1", version="006")
granule_client = GranuleApi.from_collection(collections[0], session=session)
granule_client = GranuleApi.from_collection(collections[0], session=session)
box_coords = [22.29219,103.99219, 24.96439, 105.82031]
custom_granules = granule_client.query(start_date="2020-01-01", end_date="2020-01-31", bounding_box=box_coords)
GranuleHandler.download_from_granules(custom_granules, session)

Expected behavior and actual behavior Expect to receive hdf files filled with data, in reality receiving files filled with -3000 value.

hdf = SD('MOD13Q1.A2020017.h18v01.006.2020034145702.hdf', SDC.READ)

fig, ax = plt.subplots()
im = ax.imshow(hdf.select('250m 16 days NDVI').get())

image

Your Environment:

Can't figure out the problem on which side, is it data provider or on modis-tools side.

amanbagrecha commented 1 year ago

The output is seems fine to me when corrected for one thing. Your box coordinates are in wrong format. Try box_coords = [103.99219, 22.29219, 105.82031, 24.96439 ]

iamchrisearle commented 1 year ago

Closing this issue as it has become stale. If the recommended fix has not worked, feel free to open a new issue.