sasktran2.solar.SolarModel

sasktran2.solar.SolarModel#

class sasktran2.solar.SolarModel(source='solar_irradiance_hsrs_2022_11_30_extended', ds=None, mode='sample', resolution=None, resolution_in_wavelength=True)[source]#

Bases: object

Loads in a solar model for use inside SASKTRAN2. By default the HSRS extended solar model is loaded in that has a useful wavelength range covering 115 nm to 200 microns and intgrates to 1362.8 W/m^2.

Coddington, O. M., Richard, E. C., Harber, D., Pilewskie, P., Woods, T. N., Snow, M., et al. (2023). Version 2 of the TSIS-1 Hybrid Solar Reference Spectrum and Extension to the Full Spectrum. Earth and Space Science, 10, e2022EA002637. https://doi.org/10.1029/2022EA002637

Optionally a manually specified dataset can be used, which must contain the variables “wavelength” and “irradiance”. It is assumed that “wavelength” is in units of nm and “irradiance” has spectral units of /nm.

Parameters:
  • source (str, optional) – sasktran2 database source identifier. Currently only “solar_irradiance_hsrs_2022_11_30_extended” is supported and is the default

  • ds (xr.Dataset, optional) – If set, then the dataset is used instead of the source. The dataset must contain the variables “wavelength” and “irradiance” default is None

  • mode (str, optional) – The mode of the solar model. Options are “integrate”, “average”, “sample”. Default is “sample”. If “integrate” is selected then the solar spectrum is integrated over the wavelength range of interest. If “average” is selected then the solar spectrum is averaged over the wavelength range of interest. If “sample” is selected then the solar spectrum is sampled at the wavelengths of interest. The “integrate” and “average” modes are useful for calculating the solar irradiance at a specific wavelength range and the “sample” mode is useful for calculating the solar irradiance at specific wavelengths.

  • resolution (float, optional) – The resolution to integrate the solar spectrum at. If None, then the resolution is determined by the wavelength grid. Default is None

  • resolution_in_wavelength (bool, optional) – If True, then the resolution is in wavelength units. If False, then the resolution is in wavenumber units. Default is True

__init__(source='solar_irradiance_hsrs_2022_11_30_extended', ds=None, mode='sample', resolution=None, resolution_in_wavelength=True)[source]#

Loads in a solar model for use inside SASKTRAN2. By default the HSRS extended solar model is loaded in that has a useful wavelength range covering 115 nm to 200 microns and intgrates to 1362.8 W/m^2.

Coddington, O. M., Richard, E. C., Harber, D., Pilewskie, P., Woods, T. N., Snow, M., et al. (2023). Version 2 of the TSIS-1 Hybrid Solar Reference Spectrum and Extension to the Full Spectrum. Earth and Space Science, 10, e2022EA002637. https://doi.org/10.1029/2022EA002637

Optionally a manually specified dataset can be used, which must contain the variables “wavelength” and “irradiance”. It is assumed that “wavelength” is in units of nm and “irradiance” has spectral units of /nm.

Parameters:
  • source (str, optional) – sasktran2 database source identifier. Currently only “solar_irradiance_hsrs_2022_11_30_extended” is supported and is the default

  • ds (xr.Dataset, optional) – If set, then the dataset is used instead of the source. The dataset must contain the variables “wavelength” and “irradiance” default is None

  • mode (str, optional) – The mode of the solar model. Options are “integrate”, “average”, “sample”. Default is “sample”. If “integrate” is selected then the solar spectrum is integrated over the wavelength range of interest. If “average” is selected then the solar spectrum is averaged over the wavelength range of interest. If “sample” is selected then the solar spectrum is sampled at the wavelengths of interest. The “integrate” and “average” modes are useful for calculating the solar irradiance at a specific wavelength range and the “sample” mode is useful for calculating the solar irradiance at specific wavelengths.

  • resolution (float, optional) – The resolution to integrate the solar spectrum at. If None, then the resolution is determined by the wavelength grid. Default is None

  • resolution_in_wavelength (bool, optional) – If True, then the resolution is in wavelength units. If False, then the resolution is in wavenumber units. Default is True

Methods

__init__([source, ds, mode, resolution, ...])

Loads in a solar model for use inside SASKTRAN2.

irradiance(wavelengths[, solardistance])

Calculates the solar irradiance at the specified wavelengths in nm.

irradiance(wavelengths: ndarray, solardistance: float | None = None) array[source]#

Calculates the solar irradiance at the specified wavelengths in nm. Default units are in W/m^2/nm, but can be different if a manual database is used instead. If the mode is set to “integrate” then the units will be W/m^2.

The solar distance factor can be used to scale the solar irradiance to a different distance. The default is None indicating that the solar irradiance is at 1 AU.

Parameters:
  • wavelengths (np.ndarray) – Wavelengths in [nm] to calculate the solar irradiance at

  • solardistance (float, optional) – Solar distance to scale by in AU., by default None

Returns:

The solar irradiance at the specified wavelengths

Return type:

np.array