Skip to content

Commit

Permalink
move AOI bbox from class to static
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquelynsmale committed Jan 17, 2025
1 parent 8b94b93 commit c088ea6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tools/RAiDER/aria/prepFromGUNW.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def __init__(self, path_gunw: str, wm: str, out_dir: str) -> None:
self.wm = wm
self.out_dir = Path(out_dir)

self.SNWE = self.get_bbox()
self.SNWE = get_bbox(path_gunw)
self.heights = np.arange(-500, 9500, 500).tolist()
# self.heights = [-500, 0]
self.dates, self.mid_time = self.get_datetimes()
Expand All @@ -188,9 +188,10 @@ def __init__(self, path_gunw: str, wm: str, out_dir: str) -> None:
# self.lat_file, self.lon_file = self.makeLatLonGrid_native()
# self.path_cube = self.make_cube() # not needed

def get_bbox(self) -> BB.SNWE:
@staticmethod
def get_bbox(path_gunw) -> BB.SNWE:
"""Get the bounding box (SNWE) from an ARIA GUNW product."""
with xr.open_dataset(self.path_gunw) as ds:
with xr.open_dataset(path_gunw) as ds:
poly_str = ds['productBoundingBox'].data[0].decode('utf-8')
poly = shapely.wkt.loads(poly_str)
W, S, E, N = poly.bounds
Expand Down

0 comments on commit c088ea6

Please sign in to comment.