Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Subsetting may fail when applied to a dataset with only one value in lat or lon dimension #909

Open
TonioF opened this issue Jul 29, 2020 · 0 comments
Labels
Milestone

Comments

@TonioF
Copy link
Contributor

TonioF commented Jul 29, 2020

When you create a dataset for a certain region and then create a dataset of a sub-region, you would expect to get a dataset.
Instead, you may get an error 'Can not select a region outside dataset boundaries.'
The reason is that in the current implementation of subset_spatial, the resolution of a dimension is determined as the distance between two values of the dimension. If the dimension only has one value, the resolution is assumed to be 0 (whereas it really might be up to 60°), and if the user-defined subset region does not coincidentally contan the actual dimension value, the resulting dimension will have no values, causing the error stated above.

@TonioF TonioF added the bug label Jul 29, 2020
@forman forman added this to the 3.0 milestone Apr 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants