Spectrum

class diffinytrace.spectrum.Spectrum(func: Callable[[Tensor], Tensor], bounds: Tuple[float, float])[source]

Bases: Module, PlotableWavelength

A class to represent a spectrum as a function of wavelength.

forward(wl: Tensor) Tensor[source]

Calculate the spectrum for given wavelengths.

Parameters:

wl (torch.Tensor or float) – Wavelength in μm.

Returns:

Spectrum value at the given wavelengths.

Return type:

torch.Tensor

class diffinytrace.spectrum.VisibleSunlight_am15g[source]

Bases: Spectrum

A class to represent the AM 1.5 G spectrum. This class uses the pvlib library to calculate the spectrum.