Solar Spectrum¶
- class sasktran.SolarSpectrum(name='SAO2010')¶
Bases:
object
Utility class for obtaining the solar spectrum
- Parameters:
name (str, optional) – Solar spectrum to use, valid choices are ‘sao2010’ and ‘FONTELA_UVIS_3MICRON’. Default is ‘sao2010’
Examples
>>> from sasktran import SolarSpectrum >>> spectrum = SolarSpectrum() >>> spectrum.irradiance([340, 600]) array([ 1.76034000e+14, 5.38339000e+14])
- irradiance(wavelengths, solardistance=None, mjd=None, fwhm=None, stdev=None)¶
- Parameters:
wavelengths (np.array) – Wavelengths to get the irradiance at in nm
solardistance (float, optional) – Default is None. If not None, the solardistance is set prior to getting the irradiance. Units of AU.
mjd (float, optional) – Modified Julain Data. Default is None. If not None, the solardistance is set based upon the time prior to getting the irradiance.
fwhm (float, optional) – Full width at half maximum resolution in nm to convolve the solar spectrum down to. Default is None, using the native resolution. Only one of fwhm or stdev should be set. Can either be a scalar indicating every wavelength has the same fwhm, or an array the same size at wavelengths.
stdev (float, optional) – stdev in nm to convolve the solar spectrum down to. Default is none, using the native roslution. Only one of fwhm or stdev should be set. Can either be a scalar indicating every wavelength has the same stdev, or an array the same size at wavelengths.
Notes
If neither
solardistance
ormjd
is set, then a solar distance of 1 AU is assumed.- Returns:
Irradiance at the requested wavelength in photons/cm2/sec/nm. Same size as wavelengths
- Return type:
np.array
- Raises:
ValueError – If both solardistance and mjd are simultaneously set.
Examples
>>> from sasktran import SolarSpectrum >>> spectrum = SolarSpectrum() >>> spectrum.irradiance([340, 600]) array([ 1.76034000e+14, 5.38339000e+14]) >>> spectrum.irradiance([340, 600], mjd=54372) array([ 1.75359594e+14, 5.36276563e+14]) >>> spectrum.irradiance([340, 600], solardistance=1.5) array([ 7.82373333e+13, 2.39261778e+14]) >>> spectrum.irradiance([340, 600], solardistance=1.5, fwhm=1) array([ 8.02407128e+13, 2.36113610e+14]) >>> spectrum.irradiance([340, 600], solardistance=1.5, mjd=54372) Traceback (most recent call last): ... ValueError: Can only set one of solardistance or mjd
- property max_wavelength¶
returns: Maximum wavelength in nm that this specific solar spectrum is valid for :rtype: float
Examples
>>> from sasktran import SolarSpectrum >>> spectrum = SolarSpectrum() >>> spectrum.max_wavelength 1000.99
- property min_wavelength¶
returns: Minimum wavelength in nm that this specific solar spectrum is valid for :rtype: float
Examples
>>> from sasktran import SolarSpectrum >>> spectrum = SolarSpectrum() >>> spectrum.min_wavelength 200.07
- resolution(wavelengths)¶
Gets the resolution in fwhm for the solar spectrum at a set of specific wavelengths. :param wavelengths: Wavelengths to get the resolution at :type wavelengths: np.array
- Returns:
Same size as wavelengths, resolution as fwhm in nm.
- Return type:
np.array
Examples
>>> from sasktran import SolarSpectrum >>> spectrum = SolarSpectrum() >>> spectrum.resolution([340, 600]) array([ 0.04, 0.04])
- skif_object()¶
Get the underlying skif object
- Return type:
skif.ISKSolarSpectrum
Examples
>>> from sasktran import SolarSpectrum >>> spectrum = SolarSpectrum() >>> type(spectrum.skif_object()) <class 'sasktranif.sasktranif.ISKSolarSpectrum'>