Skip to content
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

Support masked arrays #20

Closed
stephenworsley opened this issue Nov 12, 2020 · 1 comment
Closed

Support masked arrays #20

stephenworsley opened this issue Nov 12, 2020 · 1 comment
Assignees
Labels
New: Feature Highlight a new community raised "feature request" issue
Milestone

Comments

@stephenworsley
Copy link
Contributor

✨ Feature Request

Provide support for regridders to handle masked arrays. Regridders will allow control over the masked data tolerance, similar to iris area weighted conservative regridders.

Motivation

Data on iris cubes is commonly masked. Furthermore, the regridding of masked data is a situation where the user may want more control over the regridding process for performance reasons. The handling of masked data is central to the design and motivation for this package.

@stephenworsley stephenworsley added the New: Feature Highlight a new community raised "feature request" issue label Nov 12, 2020
@stephenworsley stephenworsley added this to the v0.1 milestone Nov 12, 2020
@stephenworsley stephenworsley self-assigned this Nov 12, 2020
@stephenworsley
Copy link
Contributor Author

It looks like there are two ways to normalise weights to account for masked values. These are described here and are discused here. ESMF names these normalisation types as DSTAREA and FRACAREA. For DSTAREA, the weight associated with a source cell and a target cell is the proportion of the area of the destination cell which is taken up by the overlap of the source cell and the destination cell. FRACAREA is calculated similarly, except instead of weights being a proportion of the whole destination cell, they are instead a proportion of the overlap of all unmasked source cells and that destination cell, this means that the sum of all weights associated with a destination cell is always 1. It is interesting to note that for global grids, regridding with a DSTAREA norm is the equivalent of regridding with a FRACAREA norm but replacing all masked data with 0.

It is worth noting that both norm types have advantages. DSTAREA preserves the global mean value, but distorts values near masked points. FRACAREA is more accurate near masked points but ceases to conserve global mean.

Another point worth noting is that it is possible to derive FRACAREA weights from DSTAREA weights by normalising them, but it is not possible to derive DSTAREA weights from FRACAREA weights. For this reason, we extract the DSTAREA norm from ESMF which should allow us to calculate both.

@zklaus zklaus closed this as completed in 77f2119 Dec 14, 2020
stephenworsley added a commit to stephenworsley/iris-esmf-regrid that referenced this issue Dec 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New: Feature Highlight a new community raised "feature request" issue
Projects
None yet
Development

No branches or pull requests

1 participant