Skip to content

Commit

Permalink
moves ASFSearchResults constructor up to get_baseline_from_stack()
Browse files Browse the repository at this point in the history
  • Loading branch information
SpicyGarlicAlbacoreRoll committed May 9, 2022
1 parent 80a87bc commit 9d67137
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions asf_search/baseline/calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
import numpy as np
from dateutil.parser import parse

from asf_search import ASFProduct, ASFSearchResults
from asf_search import ASFProduct
# WGS84 constants
a = 6378137
f = pow((1.0 - 1 / 298.257224), 2)
# Technically f is normally considered to just be that 298... part but this is all we ever use, so
# pre-calc and cache and call it all f anyhow

def calculate_perpendicular_baselines(reference: str, stack: List[ASFProduct]) -> ASFSearchResults:
def calculate_perpendicular_baselines(reference: str, stack: List[ASFProduct]):
for product in stack:
baselineProperties = product.baseline
positionProperties = baselineProperties['stateVectors']['positions']
Expand Down Expand Up @@ -68,7 +68,7 @@ def calculate_perpendicular_baselines(reference: str, stack: List[ASFProduct]) -
perpendicular_baseline = None
secondary.properties['perpendicularBaseline'] = perpendicular_baseline

return ASFSearchResults(stack)
return stack

# Convert granule center lat/lon to fixed earth coordinates in meters using WGS84 ellipsoid.
def get_granule_position(scene_center_lat, scene_center_lon):
Expand Down
2 changes: 1 addition & 1 deletion asf_search/baseline/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def get_baseline_from_stack(reference: ASFProduct, stack: ASFSearchResults):
else:
stack = calculate_perpendicular_baselines(reference.properties['sceneName'], stack)

return stack, warnings
return ASFSearchResults(stack), warnings

def valid_state_vectors(product: ASFProduct):
if product is None:
Expand Down

0 comments on commit 9d67137

Please sign in to comment.