validate_wavelengths

synphot.utils.validate_wavelengths(wavelengths)[source]

Check wavelengths for synphot compatibility.

Wavelengths must satisfy these conditions:

  • valid unit type, if given

  • no zeroes

  • monotonic ascending or descending

  • no duplicate values

Parameters:
wavelengthsarray-like or Quantity

Wavelength values.

Raises:
synphot.exceptions.SynphotError

Wavelengths unit type is invalid.

synphot.exceptions.DuplicateWavelength

Wavelength array contains duplicate entries.

synphot.exceptions.UnsortedWavelength

Wavelength array is not monotonic.

synphot.exceptions.ZeroWavelength

Negative or zero wavelength occurs in wavelength array.