-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #1001 more msw regrid packages simplified #1151
Issue #1001 more msw regrid packages simplified #1151
Conversation
…re_msw_regrid_packages_simplified # Conflicts: # imod/tests/test_msw/test_annual_crop_factors.py
…01_more_msw_regrid_packages_simplified
…re_msw_regrid_packages_simplified
…re_msw_regrid_packages_simplified # Conflicts: # imod/msw/grid_data.py # imod/msw/infiltration.py # imod/msw/ponding.py # imod/msw/scaling_factors.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for also cleaning up the tests. I have a few small comments, approving in advance.
imod/util/spatial.py
Outdated
@@ -736,3 +736,48 @@ def _polygonize(da: xr.DataArray) -> "gpd.GeoDataFrame": | |||
gdf = gpd.GeoDataFrame({"value": colvalues, "geometry": geometries}) | |||
gdf.crs = da.attrs.get("crs") | |||
return gdf | |||
|
|||
|
|||
def get_grid_area(array: xr.DataArray) -> float: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe: get_total_grid_area
is more explicit? "grid_area" could still mean "a grid of cell areas" if you don't know that also a function named get_cell_area
exists
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -6,6 +6,7 @@ | |||
import xugrid as xu | |||
|
|||
import imod | |||
from imod.util.spatial import get_cell_area |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see tests for get_grid_area?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Quality Gate passedIssues Measures |
8e103f4
into
metaswap_regridding_feature_branch
Fixes #1001
Description
adds regridding for metaswap packages meteo and grid_data
Adds a utility function for computing cell area and grid area for equidistant and non-equidistant grids.
Checklist
Issue #nr
, e.g.Issue #737