Skip to content
This repository has been archived by the owner on Jun 14, 2021. It is now read-only.

Start date out of range #9

Open
mark-boer opened this issue Mar 24, 2019 · 0 comments
Open

Start date out of range #9

mark-boer opened this issue Mar 24, 2019 · 0 comments

Comments

@mark-boer
Copy link

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 :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant