tidy3d.plugins.autograd.functions.threshold

Contents

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