OverrideAxis¶
Override a specific axis in the data by a new axis.
This allows you to effectively 'relabel' an axis, for instance from frequency to time, or from space (=channels) to features. The main use case is when you have processing nodes that expect a particular axis type to be present in the data, but your data has axes of a different type. The new axis will have the same number of elements than the old axis. Since most axes can store per-element information, for instance the channel labels, it is possible to give a list of initialization values for the new axis type. Version 1.5.1
Ports/Properties¶
data¶
Data to process.
- verbose name: Data
- default value: None
- port type: DataPort
- value type: Packet (can be None)
- data direction: INOUT
old_axis¶
Axis to replace. This is the type of the axis in the current data that you want to replace by a new axis. Note that you can also write feature.mylabel to reference an axis that has a specific custom label set, and thereby further refine what axis you want to override.
- verbose name: Old Axis To Override/remove
- default value: feature
- port type: ComboPort
- value type: str (can be None)
new_axis¶
New axis type to use. This is the type of axis that should replace the previous one. You can also specify a desired new label for the axis in here by writing space.mylabel.
- verbose name: New Axis To Insert
- default value: space
- port type: ComboPort
- value type: str (can be None)
init_data¶
Optional initial values for the new axis primary array. For example, use this field to provide frequencies (float in Hz) for a new frequency axis, channel names (string) for a new space axis, feature names (string) for a feature axis, time stamps (float, in seconds) for a new time axis, or lag offsets (float, in seconds) for a lag axis. For an instance axis, this list will be supplied to the InstanceAxis initializer's data array and by default will populate the Marker field of the data array. See the InstanceAxis documentation for more information. If this parameter (values for new axis) is empty, the new axis will attempt to initialize itself with information from the old axis if 'carry over labels' or 'carry over numbers' (depending on destination axis type) is set. Otherwise the new axis will be initialized with dummy values. In any event, the length of the new axis will match the length of the old axis, since there is no change in the shape of the data. If values are provided in this parameter, AND carry_over_names is True, AND labels can be inferred from the old axis, AND the new axis expects labels as its indexing array, then these values can be combined with the old labels according to the format in join_format (joining is off by default).
- verbose name: Values For New Axis
- default value: None
- port type: ListPort
- value type: list (can be None)
axis_occurrence¶
Index of the occurrence of the axis of desired type. (0 is the first axis of the desired type, 1 is the second, -1 is the last, -2 is the second-to-last, and so on). This should be rarely used. Instead, give the target axis a custom label, if it doesn't already have one (using SetAxisLabel) and specify the label in the axis property (see help for that property).
- verbose name: Axis Occurrence
- default value: 0
- port type: IntPort
- value type: int (can be None)
carry_over_names¶
Carry over labels from previous axis, if present. Retrieved label format depends on verbosity and decimals parameters and the specific axis implementation of get_labels.
- verbose name: Carry Over Labels
- default value: True
- port type: BoolPort
- value type: bool (can be None)
carry_over_numbers¶
Carry over numbers of previous axis, if present. This can be used to force the numerical axis data of the old axis into the new axis (e.g., time vs. frequency).
- verbose name: Carry Over Numbers
- default value: True
- port type: BoolPort
- value type: bool (can be None)
keep_other_arrays¶
If the old axis and new axis are the same type then it is possible to carry over any other arrays such as space positions, or frequency bandwidths.
- verbose name: Keep Arrays When Same Axis Type
- default value: False
- port type: BoolPort
- value type: bool (can be None)
keep_props¶
If the old axis and new axis are the same type then it is possible to carry over any other axis properties.
- verbose name: Keep Properties When Same Axis Type
- default value: False
- port type: BoolPort
- value type: bool (can be None)
only_signals¶
If set to true, only axes on signal chunks will be overridden.
- verbose name: Only Signals
- default value: True
- port type: BoolPort
- value type: bool (can be None)
verbosity¶
Specify the verbosity level applied to the retrieval of the labels carried over from the previous axis.
- verbose name: Verbosity
- default value: 0
- port type: IntPort
- value type: int (can be None)
decimals¶
Specify the number of places after the decimal to keep when converting old axis numeric to new axis strings. This (probably) only applies when verbosity > 0.
- verbose name: Decimals
- default value: 3
- port type: IntPort
- value type: int (can be None)
join_format¶
Determine how to proceed when values for the new axis are provided, and carry_over_names is True, and the old axis has values that can be mapped to the new axis' primary array (i.e ., names for a Space axis). Use {new} and {old} to indicate how the newly provided values, and the values from the old axis, respectively, should be used and/or combined. By default only the newly provided values, if specified, are used. Common examples: '{new}' - Any old labels are ignored. '{new} ({old})'
- verbose name: Join Format
- default value: {new}
- port type: StringPort
- value type: str (can be None)
axis_caching¶
If set to true, the axis will be cached and reused if the same inputs are encountered again for this node. This can be useful if the axis is expensive to create, but can cause churn and unnecessary overhead if details of the axis (e.g., array contents) differ with each update of this node.
- verbose name: Axis Caching
- default value: True
- port type: BoolPort
- value type: bool (can be None)
custom_label¶
Custom label to be given to the new axis; if None, the custom_label from the old axis will be copied (if any).
- verbose name: New Custom Label
- default value:
- port type: StringPort
- value type: str (can be None)
set_breakpoint¶
Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.
- verbose name: Set Breakpoint (Debug Only)
- default value: False
- port type: BoolPort
- value type: bool (can be None)
metadata¶
User-definable meta-data associated with the node. Usually reserved for technical purposes.
- verbose name: Metadata
- default value: {}
- port type: DictPort
- value type: dict (can be None)