Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions rapida/ntl/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ async def fetch(bbox:tuple[numbers.Number]=None, nominal_date:datetime=None,
download_and_track(granule, dst_dir, progress)
)
tasks.append(task)

downloaded_files = {}

for coro in asyncio.as_completed(tasks, timeout=100 * 3 * len(tasks)):
Expand All @@ -81,7 +80,7 @@ async def fetch(bbox:tuple[numbers.Number]=None, nominal_date:datetime=None,
await asyncio.gather(*tasks, return_exceptions=True)
raise

return downloaded_files
return {g.timestamp:downloaded_files[g.timestamp] for g in selected_granules if g.timestamp in downloaded_files}

expected_tiles = get_intersecting_tiles(bbox=bbox)
routes = nasaconst.ROUTES
Expand Down Expand Up @@ -151,7 +150,7 @@ async def fetch(bbox:tuple[numbers.Number]=None, nominal_date:datetime=None,
# Break out of the 'routes' loop to stop searching for this processing_level
break


print(downloaded_files)
return downloaded_files


Expand Down
4 changes: 2 additions & 2 deletions rapida/ntl/noaa/cmask.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ def select_required_granules(sorted_granules: list, bbox: tuple, progress:Progre
logger.warning("Exhausted all combinations. BBOX cannot be fully covered by available data.")
logger.warning(f"Selecting max of {combos}.")

w = max(combos)
return combos[w]
max_cov = max(combos)
return combos[max_cov]
finally:
if progress and progress_task:
progress.remove_task(progress_task)
Expand Down
4 changes: 2 additions & 2 deletions rapida/ntl/outage.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ async def detect_outage(
logger.info(f'No imagery was found for {nominal_date:"%Y%m%d"} over {bbox} {deliverable.split("_")[0]}')
logger.info(f'Consider adjusting source, date or the bounding box')
return
for timestamp, product_files in daily_results.items():
print(timestamp, product_files)


arrays = {}
# --- 1. FETCH & PROCESS MONTHLY BASELINE ---
Expand Down Expand Up @@ -73,6 +72,7 @@ async def detect_outage(

for timestamp, product_files in daily_results.items():


daily_data, cloud_mask = read_and_align_sdr_and_cmask(
sdr_path=product_files[noaa_const.SDR], geo_path=product_files[noaa_const.GEO],
cmask_path=product_files[noaa_const.CM], target_area=target_area
Expand Down
Loading