This must be verified, but I encountered problems when analyzing stational data with a depth dimension. I had to adjust the code like this to make it work
For example, in threshold()
if point:
ds["thresh"] = thresh_results[0]
ds["seas"] = seas_results[0]
else:
ds["thresh"] = xr.concat(results[0], dim='cell')
ds["seas"] = xr.concat(results[1], dim='cell')
dims = [k for k in ts.cell.coords.keys()]
if len(dims) == 1: # This would be equal to time and another dimension
ds = ds.swap_dims({"cell":dims[0]})
ds = ds.transpose("doy", dims[0])
else:
ds = ds.set_xindex(dims)
ds = ds.unstack(dim='cell')
This must be verified, but I encountered problems when analyzing stational data with a depth dimension. I had to adjust the code like this to make it work
For example, in
threshold()
The same applies to the
detect()
function.