How to define time interval in python using jupyter for S2 download and processing

Example bounding box and time interval

Define your bounding box coordinates

bbox = [78.56410997,28.60842103, 78.56424234, 28.60830052]
#time_interval = ‘2023-01-01/2023-01-31’
time_interval = ‘2023-05-04T00:00:00Z"to"2023-06-13T23:59:59Z’

Directory to save downloaded data

output_dir = ‘C:\Users\Desktop\images’

Create directory if it doesn’t exist

os.makedirs(output_dir, exist_ok=True)

#download
download_sentinel_data(bbox, time_interval, output_dir)

Read NDVI and SMI data

ndvi_data, ndvi_transform = read_raster(os.path.join(output_dir, ‘NDVI.tif’))
smi_data, smi_transform = read_raster(os.path.join(output_dir, ‘SMI.tif’))

Is above the right approach to download S2 data. I am getting this error-
ParserError: Unknown string format: 2023-01-01T00:00:00Z/2023-01-31T23:59:59Z

Hi,

To find out more about the Sentinel Hub Python package and how to use it, I recommend following through these examples.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.