Mask raw MEaSUReS velocity to MALI hull instead of pre-extrapolating - #976
Open
trhille wants to merge 2 commits into
Open
Mask raw MEaSUReS velocity to MALI hull instead of pre-extrapolating#976trhille wants to merge 2 commits into
trhille wants to merge 2 commits into
Conversation
Add optional valid-data source masking to interp_gridded2mali via a new valid_mask_varnames argument. When provided, no-data source cells (where any listed variable is non-finite) are excluded from the ESMF remapping weights in addition to the destination-hull footprint mask, and the weight-gen call gains --norm_type fracarea and --extrap_method neareststod so partially covered destination cells are renormalized and any unmapped cells are filled from the nearest valid source. This lets the AIS mesh_gen case interpolate directly from the raw (unextrapolated) MEaSUReS velocity file, excluding no-data cells from the weights rather than relying on a slow offline extrapolation. BedMachine is unchanged (bed stays real, full-extent). Extrapolated-source cases are a no-op because their all-finite fields yield an all-ones mask that leaves the gated flags off. Update AIS user guide and framework developer docs accordingly.
ESMF forbids --extrap_method with conservative regridding, so the raw MEaSUReS velocity interpolation failed. Drop the invalid flag and instead fill destination cells left unmapped by the conservative pass with nearest active-source weights computed directly via a KD-tree and merged into the conservative weight file. ESMF_RegridWeightGen is still called only once, preserving the mesh_gen compute/memory profile.
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.
Add optional valid-data source masking to interp_gridded2mali via a new valid_mask_varnames argument. When provided, no-data source cells (where any listed variable is non-finite) are excluded from the ESMF remapping weights in addition to the destination-hull footprint mask, and the weight-gen call gains --norm_type fracarea and --extrap_method neareststod so partially covered destination cells are renormalized and any unmapped cells are filled from the nearest valid source.
This lets the AIS mesh_gen case interpolate directly from the raw (unextrapolated) MEaSUReS velocity file, excluding no-data cells from the weights rather than relying on a slow offline extrapolation. BedMachine is unchanged (bed stays real, full-extent). Extrapolated-source cases are a no-op because their all-finite fields yield an all-ones mask that leaves the gated flags off.
Update AIS user guide and framework developer docs accordingly.
Checklist
api.rst) has any new or modified class, method and/or functions listedTestingin this PR) any testing that was used to verify the changes