extract_wavelengths#

PortResults.extract_wavelengths(wavelengths_in_monitor: ndarray, values_in_monitor: ndarray) ndarray#

Extract metric values at specific wavelengths.

Finds the closest available wavelength for each requested wavelength and returns the corresponding metric value if within tolerance.

Parameters:
wavelengths_in_monitoranp.ndarray

Array of wavelengths available in the monitor, in meters.

values_in_monitoranp.ndarray

Array of metric values corresponding to wavelengths_in_monitor.

Returns:
anp.ndarray

Metric values at the specified wavelengths. If a single wavelength is provided, returns a 1-element array.

Raises:
ValueError

If values or wavelengths are None (results not yet computed).

ValueError

If requested wavelength is not within tolerance of any available wavelength.