oceanspy.subsample.cutout

oceanspy.subsample.cutout(od, varList=None, YRange=None, XRange=None, add_Hbdr=False, mask_outside=False, ZRange=None, add_Vbdr=False, timeRange=None, timeFreq=None, sampMethod='snapshot', dropAxes=False, centered=None, persist=False)[source]

Cutout the original dataset in space and time preserving the original grid structure.

Parameters:
od: OceanDataset

oceandataset to subsample

varList: 1D array_like, str, or None

List of variables (strings).

YRange: 1D array_like, scalar, or None

Y axis limits (e.g., latitudes). If len(YRange)>2, max and min values are used.

XRange: 1D array_like, scalar, or None

X axis limits (e.g., longitudes). If len(XRange)>2, max and min values are used.

add_Hbdr: bool, scal

If scalar, add and subtract add_Hbdr to the the horizontal range. of the horizontal ranges. If True, automatically estimate add_Hbdr. If False, add_Hbdr is set to zero.

mask_outside: bool

If True, set all values in areas outside specified (Y,X)ranges to NaNs. (Useful for curvilinear grids).

ZRange: 1D array_like, scalar, or None

Z axis limits. If len(ZRange)>2, max and min values are used.

add_Vbdr: bool, scal

If scalar, add and subtract add_Vbdr to the the vertical range. If True, automatically estimate add_Vbdr. If False, add_Vbdr is set to zero.

timeRange: 1D array_like, numpy.ScalarType, or None

time axis limits. If len(timeRange)>2, max and min values are used.

timeFreq: str or None

Time frequency. Available optionts are pandas Offset Aliases (e.g., ‘6H’): http://pandas.pydata.org/pandas-docs/stable/timeseries.html#offset-aliases

sampMethod: {‘snapshot’, ‘mean’}

Downsampling method (only if timeFreq is not None). “snapshot” means just throw away everything in between. “mean” means take a running average with the time freq.

dropAxes: 1D array_like, str, or bool

List of axes to remove from Grid object. if one point only is in the range. If True, set dropAxes=od.grid_coords. If False, preserve original grid.

centered: str or bool.

Only used when face is a dimension. When str, ‘Atlantic’ or ‘Pacific’ are the only possible choices. Default is None and centered is estimated during the cutout.

persist: bool.

Only used when face is a dimension. If False (default) the transformation is not persisted.

Returns:
od: OceanDataset

Subsampled oceandataset

Notes

If any of the horizontal ranges is not None, the horizontal dimensions of the cutout will have len(Xp1)>len(X) and len(Yp1)>len(Y) even if the original oceandataset had len(Xp1)==len(X) or len(Yp1)==len(Y).