This repository was archived by the owner on Jun 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Start date out of rangeΒ #9
Copy link
Copy link
Open
Description
Hi everyone, really enjoy the project, very useful!
There seems to be a bug in the default argument of the start_date in the sentinel2 search function:
To reproduce:
>>> from aws_sat_api.search import sentinel2
>>> utm = 16
>>> lat = 'S'
>>> grid = 'DF'
>>> full_search = False
>>> level = 'l1c'
>>> s2_meta = sentinel2(utm, lat, grid, full_search, level)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "c:\users\mark.boer\documents\git\aws-sat-api-py\aws_sat_api\search.py", line 183, in sentinel2
raise ValueError(f"Start date out of range {start_date.year} < 2015.")
ValueError: Start date out of range 2014 < 2015.Probable solution:
I live in the Netherlands, I think this problem lies in the fact that live in a timezone with a positive timezone offset.
I think this issue can be solved by adding a tzinfo=timezone.utc to search.py line 172
start_date = start_date or datetime(2015, 1, 1, tzinfo=timezone.utc)
I'll create a PR later today :)
vincentsarago
Metadata
Metadata
Assignees
Labels
No labels