Skip to content

Commit

Permalink
static cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
asjohnston-asf committed Mar 8, 2025
1 parent 566247e commit 09e113f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
7 changes: 4 additions & 3 deletions scripts/get_frame_list_from_cmr.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def get_frame_number(item):
for attr in item['umm']['AdditionalAttributes']:
if attr['Name'] == 'FRAME_NUMBER':
return int(attr['Values'][0])
raise ValueError(f'FRAME_NUMBER not found for granule {item['umm']['GranuleUR']}')
raise ValueError(f'FRAME_NUMBER not found for granule {item["umm"]["GranuleUR"]}')


def get_granules(direction):
Expand All @@ -15,7 +15,8 @@ def get_granules(direction):
('short_name', 'OPERA_L3_DISP-S1_V1'),
# TODO update PRODUCT_VERSION requirement if/when we want to focus on v1.0 data in CMR UAT
# TODO remove PRODUCT_VERSION requirement when we start working with CMR production?
('attribute[]', ['float,PRODUCT_VERSION,0.9,', f'string,ASCENDING_DESCENDING,{direction}']),
('attribute[]', 'float,PRODUCT_VERSION,0.9,'),
('attribute[]', f'string,ASCENDING_DESCENDING,{direction}'),
('page_size', 2000),
]
# TODO update to include bearer auth when we start working with the hidden collection in CMR production
Expand All @@ -35,7 +36,7 @@ def get_granules(direction):
def get_frames_for_direction(direction: str) -> list:
granules = get_granules(direction)
frames = {get_frame_number(granule) for granule in granules}
# TODO remove frames that won't be successfully processed, e.g. 21518 with disjoint temporal coverage in CMR UAT
# TODO remove frames that won't be successfully processed, e.g. 21518 with disjoint temporal coverage in CMR UAT
return sorted(list(frames))


Expand Down
8 changes: 5 additions & 3 deletions scripts/weekly-tileset-generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ def build_job(name: str, measurement_type: str, frames: list[int]) -> dict:
'measurement_type': measurement_type,
'frame_ids': frames,
'start_date': '20140101',
'end_date': '20260101'
}
'end_date': '20260101',
},
}


Expand All @@ -47,7 +47,9 @@ def main():
jobs = HyP3.watch(jobs, timeout=21600, interval=120)

for job in jobs:
response = requests.get(f'https://hyp3-opera-disp-sandbox-contentbucket-ibxz8lcpdo59.s3.us-west-2.amazonaws.com/{job.job_id}/tms/openlayers.html')
response = requests.get(
f'https://hyp3-opera-disp-sandbox-contentbucket-ibxz8lcpdo59.s3.us-west-2.amazonaws.com/{job.job_id}/tms/openlayers.html'
)
response.raise_for_status()

for job in jobs:
Expand Down

0 comments on commit 09e113f

Please sign in to comment.