ClimoAccessor.truncate¶
- ClimoAccessor.truncate(bounds=None, *, ignore_extra=False, dataset=None, **kwargs)[source]¶
Restrict the coordinate range using
ClimoAccessor.interp
. Conceptually, inserts conincident centers and boundaries that mark the new edges of the coordinate range. The cell measure weights are redistributed accordingly.- Parameters
bounds (dict-like, optional) – The bounds specifications. For e.g. latitude dimension
lat
, the entries should look likelat_min=min_value
,lat_max=max_value
,lat_lim=(min, max)
, or the shorthandlat=(min, max)
.dataset (xarray.Dataset, optional) – The associated dataset. Used to retrieve coordinate bounds if available.
**kwargs – The bounds specifications passed as keyword args.
Notes
If cell measures are present, we assume internal level boundaries are unchanged by edges of coordinate range. So, cell measures on new coordinate edges are just scaled-down version of old cell measures. By contrast, if cell measures are missing, boundaries and measures auto-generated by
coords
will assume new boundary is halfway between new edge and old internal boundary.