Skip to content

Commit

Permalink
Randomize the slick order to avoid buggy slicks
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaraphael committed Nov 21, 2024
1 parent 3355ef1 commit 7bfcfba
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cerulean_cloud/cloud_function_ais_analysis/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import asyncio
import os
import random

import geopandas as gpd
import pandas as pd
Expand Down Expand Up @@ -85,11 +86,13 @@ async def handle_asa_request(request):
)
if overwrite_previous:
for slick in slicks:
print(f"Deactivating sources for slick {slick.id}")
await db_client.deactivate_sources_for_slick(slick.id)

print(f"# Slicks found: {len(slicks)}")
print(f"{len(slicks)} slicks in scene {scene_id}: {[s.id for s in slicks]}")
if len(slicks) > 0:
analyzers = [ASA_MAPPING[source](s1_scene) for source in run_flags]
random.shuffle(slicks) # Allows rerunning a scene to skip bugs
for slick in slicks:
# Convert slick geometry to GeoDataFrame
slick_geom = wkb.loads(str(slick.geometry)).buffer(0)
Expand Down

0 comments on commit 7bfcfba

Please sign in to comment.