Skip to content

← elementwise_math package

Step

Map the input data through a single interval step function.

Beware that the defaults do NOT reflect the mathematical (Heaviside) step function shown in the icon, but rather a common use case in statistical thresholding, in that the below/above threshold values are swapped, and the threshold is 0.05. Input values that are below a threshold are mapped to one constant value (i.e., 1.0), and values that are above the threshold are mapped to another constant value (i.e., 0.0). One example of using this node would be for converting the p-values coming from the TTest node into a binary (0/1) mask, then feeding the the resulting 0 or 1 values into the Multiply node to threshold data by statistical significance. For multiple interval thresholding, use the Discretize node. If nan is specified as the below_ or above_thresh value, the thresholded values will be replaced with NaN. This is useful for masking out data for plotting purposes, for example. Version 1.6.0

Ports/Properties

data

Data to process.

  • verbose name: Data
  • default value: None
  • port type: DataPort
  • value type: AnyNumeric (can be None)
  • data direction: INOUT

below_thresh

Output level below threshold (or threshold1). Input values that are smaller or equal to the threshold (threshold1) will be mapped to this value. Use 'nan' to replace thresholded values with NaNs, and use 'ignore' to not replace values below the threshold (only those above).

  • verbose name: Value If Below Threshold
  • default value: 1.0
  • port type: Port
  • value type: object (can be None)

above_thresh

Output level above threshold (or threshold1). Input values that are larger than the threshold (or threshold1) will be mapped to this value. Use 'nan' to replace thresholded values with NaNs, and use 'ignore' to not replace values below the threshold (only those above).

  • verbose name: Value If Above Threshold
  • default value: 0.0
  • port type: Port
  • value type: object (can be None)

threshold

Threshold value. Values that are smaller than or equal to the threshold will be mapped to the below-threshold constant, and values that are larger will be mapped to the above-threshold constant. Leave empty to perform no thresholding. threshold1 is an alias for this parameter.

  • verbose name: Threshold
  • default value: 0.05
  • port type: FloatPort
  • value type: float (can be None)

pass_nan

If set the nan values will be passed unchanged from input to output data.

  • verbose name: Passthrough Nan
  • default value: False
  • port type: BoolPort
  • value type: bool (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)