tidy3d.plugins.autograd.functions.threshold#
- class threshold[source]#
Bases:
Apply a threshold to an array, setting values below the threshold to vmin and values above to vmax.
- Parameters:
array (NDArray) β The input array to be thresholded.
vmin (float = 0.0) β The value to assign to elements below the threshold.
vmax (float = 1.0) β The value to assign to elements above the threshold.
level (Union[float, None] = None) β The threshold level. If None, the threshold is set to the midpoint between vmin and vmax.
- Returns:
The thresholded array.
- Return type:
NDArray
Inherited Common Usage