diff --git a/landsat/src/main.py b/landsat/src/main.py index 38ad3fc3..6120810d 100644 --- a/landsat/src/main.py +++ b/landsat/src/main.py @@ -47,15 +47,17 @@ def _search_date(date_string: str) -> datetime: def _qualifies_for_processing(item: pystac.item.Item, max_cloud_cover: int = MAX_CLOUD_COVER_PERCENT) -> bool: - return item.collection_id == 'landsat-c2l1' and \ - 'OLI' in item.properties['instruments'] and \ - item.properties['landsat:collection_category'] in ['T1', 'T2'] and \ - item.properties['eo:cloud_cover'] < max_cloud_cover and \ - item.properties['view:off_nadir'] == 0 and \ - item.properties['landsat:wrs_path'] + item.properties['landsat:wrs_row'] in LANDSAT_TILES_TO_PROCESS + return ( + item.collection_id == 'landsat-c2l1' + and 'OLI' in item.properties['instruments'] + and item.properties['landsat:collection_category'] in ['T1', 'T2'] + and item.properties['landsat:wrs_path'] + item.properties['landsat:wrs_row'] in LANDSAT_TILES_TO_PROCESS + and item.properties['eo:cloud_cover'] < max_cloud_cover + and item.properties['view:off_nadir'] == 0 + ) -def _check_scene(scene: str, max_cloud_cover: int = MAX_CLOUD_COVER_PERCENT) -> None: +def _check_scene(scene: str, max_cloud_cover: int = MAX_CLOUD_COVER_PERCENT) -> None: collection = LANDSAT_CATALOG.get_collection(LANDSAT_COLLECTION) item = collection.get_item(scene) assert item is not None