Zonal Coastal FIM Dockerized Lambda [Atlantic Gulf ANA and MRF NBM 10 Day Max Only] #1142
Merged
nickchadwick-noaa merged 28 commits intotifrom May 8, 2025
Merged
Zonal Coastal FIM Dockerized Lambda [Atlantic Gulf ANA and MRF NBM 10 Day Max Only] #1142nickchadwick-noaa merged 28 commits intotifrom
nickchadwick-noaa merged 28 commits intotifrom
Conversation
… Added mapx/sql/yml files
Loose ends left hanging to pivot to cleaning up and standardizing the docker image stuff
Replaced boto3 with fsspec updated error handling moved SQLAlechmy create engine to the global level instead of doing it internally in helper function replaced manual temp folder management with tempfile module removed redundant "inundated" attribute from database removed gc.collect()
Removed boto3
…ension install/load method. Improved error handling.
…e. Enabled in initialize pipeline lambda.
…WP/hydrovis into zonal-coastal-fim-dev-2.2
… DuckDB redundant check from lambda_function.py.
groutr
reviewed
May 6, 2025
groutr
reviewed
May 6, 2025
groutr
reviewed
May 6, 2025
groutr
reviewed
May 7, 2025
groutr
reviewed
May 7, 2025
groutr
reviewed
May 7, 2025
| try: | ||
| with rasterio.open(raster_path) as src: | ||
| print(" Reading depth raster...") | ||
| image_depth = src.read(1, masked=False).astype(rasterio.float32) |
Contributor
There was a problem hiding this comment.
This might be a more efficient way to construct the dataframe of shapes.
import operator
from shapely.geometry import shape
#------------------------
image_depth = src.read(1, out_dtype='float32', masked=True)
masked = image_depth > 0
raster_shapes = map(operator.itemgetter(0), features.shapes(masked.data, mask=~masked.mask, transform=transform))
gdf_polygons = gpd.GeoDataFrame(crs=raster_crs, geometry=list(map(shape, raster_shapes)))
Contributor
There was a problem hiding this comment.
The line masked = image_depth > 0 above should read masked = np.ma.masked_less_equal(image_depth, 0)
…tion. Removed hard coded python executable path. Removed unused imports.
shawncrawley
previously requested changes
May 7, 2025
Collaborator
shawncrawley
left a comment
There was a problem hiding this comment.
A few more things and we should be good to go!
…WP/hydrovis into zonal-coastal-fim-dev-2.2
groutr
reviewed
May 8, 2025
nickchadwick-noaa
previously approved these changes
May 8, 2025
nickchadwick-noaa
approved these changes
May 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the first implementation of the new barycentric method for Coastal FIM developed by Arash Rad and Mike Johnson. The zonal fim repository can be found here: https://github.com/owp-spatial/zonal-fim/tree/main.
This initial test is only for the Atlantic gulf, for ANA and MRF NBM 10 Day Max forecasts, and limited to just inundation extent.
Additions
Removals
Changes
Testing
Screenshots
Notes
Todos
Checklist
Testing checklist
Target Environment support
Accessibility
Other