1

I am having a go at using the sentinelsat python API to download satellite imagery. However, I am receiving error messages when I try to convert to a pandas dataframe. This code works and downloads my requested sentinel satellite images:

from sentinelsat import SentinelAPI, read_geojson, geojson_to_wkt
from datetime import date

api = SentinelAPI('*****', '*****', 'https://scihub.copernicus.eu/dhus')

footprint = geojson_to_wkt(read_geojson('testAPIpoly.geojson'))

products = api.query(footprint, cloudcoverpercentage = (0,10))

#this works  
api.download_all(products)

However if I instead attempt to convert to a pandas dataframe

#api.download_all(products)

#this does not work
products_df = api.to_dataframe(products)

api.download_all(products_df)

I receive an extensive error message that includes

"sentinelsat.sentinel.SentinelAPIError: HTTP status 500 Internal Server Error: InvalidKeyException : Invalid key (title) to access Products "

(where (title) is also replaced with processed, platformname, processingbaseline, etc.). I've tried a few different ways to convert to a dataframe and filter/sort results and have received an error message every time (note: I have pandas/geopandas installed). How can I convert to a dataframe and filter/sort with the sentinelsat API?

1

From #216: "The download_all method does not accept a DataFrame as input. However, you can use the index in the dataframe as a direct input to the download method."

api.download_all(products_df.index)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.