WrightTools.data.Data.chop
- Data.chop(*args, at=None, parent=None, verbose=True) Collection [source]
Divide the dataset into its lower-dimensionality components.
- Parameters:
axis (str or int (args)) – Axes of the returned data objects. Strings refer to the names of axes in this object, integers refer to their index. Provide multiple axes to return multidimensional data objects.
at (dict (optional)) – Choice of position along an axis. Keys are axis names, values are lists
[position, input units]
. If exact position does not exist, the closest valid position is used.parent (WrightTools Collection instance (optional)) – Collection to place the new “chop” collection within. Default is None (new parent).
verbose (bool (optional)) – Toggle talkback. Default is True.
- Returns:
Collection of chopped data objects.
- Return type:
WrightTools Collection
Examples
>>> data.axis_names ['d2', 'w1', 'w2']
Get all w1 wigners.
>>> datas = data.chop('d2', 'w1') >>> len(datas) 51
Get 2D frequency at d2=0 fs.
>>> datas = data.chop('w1', 'w2', at={'d2': [0, 'fs']}) >>> len(datas) 0 >>> datas[0].axis_names ['w1', 'w2'] >>> datas[0].d2[:] 0.