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.
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.
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.
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).
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).
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.
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).
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.
keep_props¶
If the old axis and new axis are the same type then it is possible to carry over any other axis properties.
only_signals¶
If set to true, only axes on signal chunks will be overridden.
verbosity¶
Specify the verbosity level applied to the retrieval of the labels carried over from the previous axis.
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.
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})'
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.
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).
set_breakpoint¶
Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.
metadata¶
User-definable meta-data associated with the node. Usually reserved for technical purposes.