lentil.radiometry.Spectrum#
- class lentil.radiometry.Spectrum(wave, value, waveunit='nm', valueunit=None)[source]#
- Class for representing spectral quantities. - Spectrumprovides core functionality for defining and interacting with spectral data in lentil. Some basic arithmetic functions are overloaded, so you can add, multiply, and exponentiate- Spectrumobjects- with each other 
- by constants 
- with arrays having the same length as - value
 - Parameters:
- wave (array_like) – Array of wavelengths. 
- value (array_like) – Array of values corresponding to wavelengths in - wave.
- waveunit (str, optional) – Wavelength units, as accepted by - Unit(). Default is- nm.
- valueunit (str or None, optional) – Value units, as accepted by - Unit(). Default is None.
 
 - Notes - When performing arithmetic operations between two - Spectrumobjects, the code will behave differently depending on the- wavevectors of each- Spectrum:- 1. If the - wavevectors of each- Spectrumare the same, the arithmetic operation is directly performed element-wise on the- valuevectors of each- Spectrum.- 2. If the - wavevectors of each- Spectrumare different, the- valuevectors of each- Spectrumare interpolated to the same sampling, and then the arithmetic operation is performed element-wise on the resulting interpolated- valuevectors. Before interpolating, the- waveand- valuevectors are zero-padded to cover the entire wave range represented by the union of both- Spectrumobjects. The sampling is determined by the smaller sampling of the two- wavevectors.- You can fine tune the sampling, interpolation, and padding methods by interfacing directly with the - Spectrum.add()and- Spectrum.multiply()methods.
Attributes
Methods
| 
 | Add Spectrum and other, element-wise | 
| 
 | Append Spectrum to the end of caller | 
| 
 | Return  | 
| 
 | Compute a binned representation of the  | 
| 
 | |
| 
 | Crop a  | 
| 
 | Divide Spectrum and other, element-wise | 
| 
 | Locate the indices defining the continuous nonzero portion of the  | 
| 
 | Create a  | 
| 
 | Compute the integrated value between  | 
| 
 | Multiply Spectrum and other, element-wise | 
| 
 | Pad a Spectrum | 
| 
 | Spectrum elements raised to powers from other, element-wise | 
| 
 | Sample the  | 
| 
 | Sample the  | 
| 
 | Subtract Spectrum and other, element-wise | 
| 
 | Set new wavelength and/or value units. | 
| 
 | Trim the zero or near-zero ends off the  |