Closed agstephens closed 4 years ago
@agstephens Interesting. You mean how best to implement subset along a z/elevation axis? I think it would make the most sense there as well. I don't imagine it would be too difficult to implement.
@Zeitsperre: yes, we are talking about the "z" axis. Let's discuss when we meet how to set this up in clisops.core.subset.
I am hoping that the Xarray/Dask lazy evaluation means that we can chain a subset_level
function with the other existing functions rather than modifying what already works.
I think that we should consider this in the same way subset_time
is addressed within the subset_bbox
function:
subset_bbox
has the optional arguments start_date
and end_date
, at the end of the function there is optionally a call to subset_time
.
We could imagine that the 'z' axis could be handled in the same way, by adding (and integrating) the following:
def subset_level(ds, start_level, end_level)
This would need to:
I realize that the number of existing decorators is getting a bit unwieldy but given that checks exist for X and Y dims, the best option I would suggest for the start_level
and end_level
checks would be to write a check_levels
decorator (or expand the check_lons
as I mentioned in #65) to be able to add this easily to other subsetting functions.
If a function is written to perform the Z-axis subsetting, it can be added to all other subsetting functions, as needed. In-depth level check could be added to either function or the decorator, I imagine.
With all these different functions, it would be interesting to consider alternative means of calling these functions down-the-line Perhaps something to consider if clisops
proceeds with #37.
Now merged into master.
Discuss with Ouranos how we should implement this. Maybe inside
clisops.core.subset
.