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 (np.ndarray) – The input array to be projected.

  • width (float = 0.1) – The width of the ramp.

  • center (float 0.5) – The center of the ramp.

Returns:

The array after applying the ramp projection.

Return type:

np.ndarray

Inherited Common Usage