tidy3d.plugins.autograd.invdes.ramp_projection

Contents

tidy3d.plugins.autograd.invdes.ramp_projection#

class ramp_projection[source]#

Bases:

Apply a piecewise linear ramp projection to an array.

This function performs a ramp projection on the input array, modifying its values based on the specified width and center. Values within the range [center - width/2, center + width/2] are linearly transformed, while values outside this range are projected to 0 or 1. The input and output is assumed to be within the range [0, 1].

Parameters:
  • array (NDArray) – The input array to be projected.

  • width (float, optional) – The width of the ramp. Default is 0.1.

  • center (float, optional) – The center of the ramp. Default is 0.5.

Returns:

The array after applying the ramp projection.

Return type:

NDArray

Inherited Common Usage