Comments (5)
Possible related issue:
from daops.
This is actually related to #61 but this time we get a different error because this is a curvilinear grid, and subset_bbox
tries to mask variables after the initial subset.
The longitude bounds mean that there is no x
data in the requested subset.
I think we need an extra check in subset_bbox
for the curvilinear case along the lines of
if da[lat].size == 0 or da[lon].size == 0:
raise ValueError(
"There were no valid data points found in the requested subset. Please expand "
"the area covered by the bounding box."
)
as well as the check implemented for #61, which checks after the level and time subsets as well.
from daops.
The order of the latitude bounds doesn't make a difference in this case because the bounds get flipped by assign_bounds
which is called here: https://github.com/roocs/clisops/blob/3e89de464db8569126b91aaa2b1ad8aa50eade2d/clisops/core/subset.py#L834-L836
from daops.
I tried to recreate this with a test dataset - still curvilinear and tos
but a different dataset (/badc/cmip6/data/CMIP6/CMIP/MPI-M/MPI-ESM1-2-HR/historical/r1i1p1f1/Omon/tos/gn/v20190710/
). I used one time step with the full lat/lon.
I've tried various lat/lon bounds but can't get the same issue, however it has identified another error that can occur with curvilinear grids when the lat/ lon bounds are too small:
clisops/ops/subset.py:168: in subset
return op.process()
clisops/ops/base_operation.py:89: in process
processed_ds = self._calculate()
clisops/ops/subset.py:64: in _calculate
result = subset_bbox(ds, **self.params)
clisops/core/subset.py:251: in func_checker
return func(*args, **kwargs)
clisops/core/subset.py:855: in subset_bbox
coord=da[d], bounds=[coords.min().values, coords.max().values], dim=d
../venv/lib/python3.7/site-packages/xarray/core/common.py:46: in wrapped_func
return self.reduce(func, dim, axis, skipna=skipna, **kwargs)
../venv/lib/python3.7/site-packages/xarray/core/dataarray.py:2518: in reduce
var = self.variable.reduce(func, dim, axis, keep_attrs, keepdims, **kwargs)
../venv/lib/python3.7/site-packages/xarray/core/variable.py:1633: in reduce
data = func(self.data, **kwargs)
../venv/lib/python3.7/site-packages/xarray/core/duck_array_ops.py:337: in f
return func(values, axis=axis, **kwargs)
../venv/lib/python3.7/site-packages/xarray/core/duck_array_ops.py:56: in f
return wrapped(*args, **kwargs)
<__array_function__ internals>:6: in amin
???
../venv/lib/python3.7/site-packages/numpy/core/fromnumeric.py:2793: in amin
keepdims=keepdims, initial=initial, where=where)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
obj = array([], dtype=int32), ufunc = <ufunc 'minimum'>, method = 'min', axis = None, dtype = None, out = None, kwargs = {'initial': <no value>, 'keepdims': <no value>, 'where': <no value>}, passkwargs = {}
def _wrapreduction(obj, ufunc, method, axis, dtype, out, **kwargs):
passkwargs = {k: v for k, v in kwargs.items()
if v is not np._NoValue}
if type(obj) is not mu.ndarray:
try:
reduction = getattr(obj, method)
except AttributeError:
pass
else:
# This branch is needed for reductions like any which don't
# support a dtype.
if dtype is not None:
return reduction(axis=axis, dtype=dtype, out=out, **passkwargs)
else:
return reduction(axis=axis, out=out, **passkwargs)
> return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
E ValueError: zero-size array to reduction operation minimum which has no identity
../venv/lib/python3.7/site-packages/numpy/core/fromnumeric.py:90: ValueError
from daops.
closed by roocs/clisops#156
from daops.
Related Issues (20)
- Add features: CLI (subset only), Dockerfile and CWL file to the repo HOT 3
- order of elements of area needed for doc strings
- consolidate expects file path with DRS folder structure HOT 5
- Update test data management (daops) to use gitpython HOT 2
- Testing integration of daops as backend for cmip6_preprocessing HOT 1
- daops production error: ZeroDivisionError: float divmod() - with tiny (lat, lon) box HOT 5
- New intake catalog approach could speed up `consolidate` step
- IndexError: list index out of range HOT 3
- Check all occurrences of `open_dataset` and `open_xr_dataset` use `roocs-utils` version of the function HOT 4
- Can we delete reference to "orchestrate"? HOT 1
- daops: subset-by-point
- daops.consolidate() is inefficient if lots of files - can we provide hints in the file path mapper? HOT 3
- Could decadal fixes derive leadtime values on-the-fly? HOT 6
- daops consolidate - need to check why return types are different
- Fix lookup of catalogs in consolidate so that multiple catalogs could be used (e.g. cmip6 AND cmip5)
- Replicate content between ES indexes HOT 2
- Some CORDEX fixes have been captured by the py-cordex project
- Just send the command-line options directly into the `subset` function HOT 1
- Add unit tests for command-line HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from daops.