Skip to content
Merged
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
32 changes: 16 additions & 16 deletions src/SearchAPI/application/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,22 +268,22 @@ def validate_wkt(wkt: str):
}

def _get_aria_baseline_stack(reference: str, opts: asf.ASFSearchOptions, output: str):
if output.lower() == 'count':
stack_opts = asf.Products.ARIAS1GUNWProduct.get_stack_opts_for_frame(int(reference), opts=opts)
count=asf.search_count(opts=stack_opts)
return Response(
content=str(count),
status_code=200,
media_type='text/html; charset=utf-8',
headers=constants.DEFAULT_HEADERS
)
try:
stack = asf.stack_from_id(reference, opts=opts)
response_info = as_output(stack, output)
return Response(**response_info)
except (KeyError, IndexError, ValueError) as exc:
raise HTTPException(detail=f"Reference scene not found with frame: {reference}", status_code=400) from exc

if output.lower() == 'count':
stack_opts = asf.Products.ARIAS1GUNWProduct.get_stack_opts_for_frame(int(reference), opts=opts)
count=asf.search_count(opts=stack_opts)
return Response(
content=str(count),
status_code=200,
media_type='text/html; charset=utf-8',
headers=constants.DEFAULT_HEADERS
)
try:
stack = asf.stack_from_id(reference, opts=opts)
response_info = as_output(stack, output)
return Response(**response_info)
except (KeyError, IndexError, ValueError) as exc:
raise HTTPException(detail=f"Ran into an issue building stack for frame: {reference}\nException: {str(exc)}", status_code=400) from exc

@router.get('/', response_class=JSONResponse)
@router.get('/health', response_class=JSONResponse)
Expand Down