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

extract_levels fails silently when scheme='nearest' or 'linear' and layer is shallower than shallowest point in z axis. #1493

Open
ledm opened this issue Feb 15, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@ledm
Copy link
Contributor

ledm commented Feb 15, 2022

The extract_levels preprocessor fails silently when a layer is requested which is shallower than the shallowest point in the ocean z axis, for the schemes nearest and linear. The resulting output is a cube where all points are masked.

Many ocean models first layer is around 1m thick, and the cell centre will be around 0.5m deep. If you use extract_levels to request a layer close to the surface, like 0.1m deep, it will produce a fully masked cube silently.

ie:

    extract_levels:
       scheme: nearest
       levels: [0.1 ,]

The solution to this problem exists already (yay!), we need to use the scheme nearest_extrapolate or linear_extrapolate, but some kind of warning or error would be useful. This information may exist in the documentation, but a clear error message is worth ten pages of documentation.

The check would be to look whether any of the depth values in the input list fall outside the min/max z range given by the model. The output message would be something like: "It looks like this depth level is output the depth cell centres. Please use the nearest_extrapolate or linear_extrapolate schemes. "

Alternatively, perhaps we also fix the “nearest” calculation so that it looks at the lat/lon/depth boundaries? @schlunma and @valeriupredoi think this is harder to do though.

Note that this problem may also occur in the atmosphere or at the sea floor, but I haven't checked.

@schlunma schlunma changed the title Extract_layer fails silently when scheme='nearest' or 'linear' and layer is shallower than shallowest point in z axis. extract_levels fails silently when scheme='nearest' or 'linear' and layer is shallower than shallowest point in z axis. Feb 16, 2022
@schlunma schlunma added the enhancement New feature or request label Feb 16, 2022
@schlunma schlunma added this to the v2.6.0 milestone Feb 16, 2022
@valeriupredoi
Copy link
Contributor

cheers @ledm - a good issue indeed! 🍺

@sloosvel sloosvel removed this from the v2.6.0 milestone Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants