tlpipe.plot.plot_slice.Timestream.data_operate¶
-
Timestream.
data_operate
(func, op_axis=None, axis_vals=0, full_data=False, copy_data=False, show_progress=False, progress_step=None, keep_dist_axis=False, **kwargs)[source]¶ An overload data operation interface.
This overloads the method in its super class
container.BasicTod
to provide basic operation interface to both vis (the main data) and vis_mask.You can use this method to do some constrained operations to vis and vis_mask hold in this container, i.e., the operations will not change the shape and dtype of vis and vis_mask before and after the operation.
Parameters: - func (function object) – The opertation function object. It is of type func(vis, vis_mask, self, **kwargs) if op_axis=None, func(vis, vis_mask, local_index, global_index, axis_val, self, **kwargs) else.
- op_axis (None, string or integer, tuple of string or interger, optional) – Axis along which func will opterate. If None, func will operate on the whole main dataset (but note: since the main data is distributed on different processes, func should not have operations that depend on elements not held in the local array of each process), if string or interger func will opterate along the specified axis, that is, it will loop the specified axis and call func on data section corresponding to the axis index, if tuple of string or interger, func will operate along all these axes.
- axis_vals (scalar or array, tuple of scalar or array, optional) – Axis value (or tuple of axis values) corresponding to the local section along the op_axis that will be passed to func if op_axis is not None. Default 0.
- full_data (bool, optional) – Whether the operations of func will need the full data section corresponding to the axis index, if True, the main data will first redistributed along the op_axis. Default False.
- copy_data (bool, optional) – If True, func will operate on a copy of the data, so changes will have no impact on the data the container holds. Default False.
- show_progress (bool, optional) – If True, some progress info will show during the executing. Default False.
- progress_step (int or None) – Show progress info every this number of steps. If None, appropriate progress step will be chosen automatically. Default None.
- keep_dist_axis (bool, optional) – Whether to redistribute main data to the original dist axis if the dist axis has changed during the operation. Default False.
- **kwargs (any other arguments) – Any other arguments that will passed to func.