PNorm#
- lumopt2.utils.common.PNorm(target: float | int | ~numpy.ndarray = 1.0, p: int | float | ~autograd.numpy.numpy_wrapper.wrap_intdtype.<locals>.IntdtypeSubclass | ~numpy.floating = 1.0, weights: float | int | ~numpy.ndarray = 1.0) callable#
Create a p-norm based figure of merit function.
- Parameters:
- target
floator array_like,optional Target transmission (scalar or array of same size as wavelengths, default: 1).
- p
float,optional P-norm to use (default: 1).
- weights
floator array_like,optional Wavelength-dependent weights (scalar or array of same size as wavelengths, default: 1).
- target
- Returns:
CallableFunction that computes the p-norm FOM for a given port.
- Raises:
TypeErrorIf target, p, or weights are not numeric types.
ValueErrorIf p is not positive, or if weights contains negative values.