Skip to content

Commit

Permalink
add more specific error, dont suppress exception
Browse files Browse the repository at this point in the history
  • Loading branch information
scottstanie committed Sep 30, 2024
1 parent f1af109 commit 8d132e7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/opera_utils/_cslc.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,13 +439,13 @@ def make_nodata_mask(
test_f = f"NETCDF:{opera_file_list[-1]}:{dataset_name}"
# convert pixels to degrees lat/lon
gt = _get_raster_gt(test_f)
# TODO: more robust way to get the pixel size... this is a hack
# maybe just use pyproj to warp lat/lon to meters and back?
dx_meters = gt[1]
dx_degrees = dx_meters / 111000
buffer_degrees = buffer_pixels * dx_degrees
except RuntimeError:
raise ValueError(f"Unable to open {test_f}")
except RuntimeError as e:
raise ValueError(f"Unable to get geotransform from {test_f}") from e
# TODO: more robust way to get the pixel size... this is a hack
# maybe just use pyproj to warp lat/lon to meters and back?
dx_meters = gt[1]
dx_degrees = dx_meters / 111000
buffer_degrees = buffer_pixels * dx_degrees

# Get the union of all the polygons and convert to a temp geojson
union_poly = get_union_polygon(opera_file_list, buffer_degrees=buffer_degrees)
Expand Down

0 comments on commit 8d132e7

Please sign in to comment.