Light Sources

This class allows you to create and manage different light sources to be used in the solar cell solvers or as a standalone tool.

  • get_default_spectral2_object
  • calculate_spectrum_spectral2
  • get_default_smarts_object
  • calculate_spectrum_smarts
  • reference_spectra
  • LightSource

Description of functions and modules

solcore.light_source.light_source.reference_spectra()[source]

Function providing the standard reference spectra: AM0, AM1.5g and AM1.5d.

Returns:A 2D array with 4 columns representing the wavelength, AM0, AM1.5g and AM1.5d standard spectra.
class solcore.light_source.light_source.LightSource(source_type, x=None, **kwargs)[source]

This is a common interface to access all types of light sources supported by Solcore: standard solar spectra (AM0, AM1.5g, and AM1.5d), blackbody radiation, laser light or spectra created from atmospheric data using SPECTRAL2 or SMARTS. Aditionally, it can also use experimentally measured spectra.

type_of_source = ['laser', 'black body', 'standard', 'SMARTS', 'SPECTRAL2', 'custom']
output_units = ['power_density_per_eV', 'power_density_per_nm', 'power_density_per_J', 'power_density_per_mphoton_flux_per_eV', 'photon_flux_per_nm', 'photon_flux_per_J', 'power_density_per_hz', 'photon_flux_per_hz', 'photon_flux_per_m']
spectrum(x=None, **kwargs)[source]

Returns the spectrum of the light in the requested units. Internally, the spectrum is always managed in power density per nanometers, but the output can be provided in other compatible units, such as power density per Hertz or photon flux per eV.

Parameters:
  • x – (Default=None) If “x” is provided, it must be an array with the spectral range in which to calculate the spectrum. Depending on the “units” defined when creating the light source, this array must be in nm, m, eV, J or hz.
  • kwargs – Options to update the light source. It can be “units”, “concentration” or any of the options specific to the chosen type of light source.
Returns:

Array with the spectrum in the requested units

solcore.light_source.smarts.skipper(fname)[source]
solcore.light_source.smarts.calculate_spectrum_smarts(smarts_file_contents=None, filename='smarts295', target_directory=None)[source]
Parameters:
  • smarts_file_contents
  • filename
  • target_directory
Returns:

solcore.light_source.smarts.build_smarts_file(**kwargs)[source]
solcore.light_source.smarts.get_default_smarts_object()[source]
Provides a dictionary with most of the parameters (values of the CARDS) needed by SMARTS to calculate
a solar spectrum. It can be used as a template to customize for user defined conditions.
Returns:
solcore.light_source.spectral2.equation_of_time(day_angle)[source]
solcore.light_source.spectral2.loadUtilitySpectra()[source]
solcore.light_source.spectral2.get_default_spectral2_object()[source]

Returns a default state object for use with calculate_spectrum. Parameters returned are for: - Coventry (52.39°N,-1.56°E) - for 12:30 pm on the 30th of June 2011 (that’s in the future!) (not any more..) - rural atmospheric conditions - 30% humidity - 1.42mm precipitated water - 1030 hPa atmospheric pressure - 0.34mm of Ozone - turbidity of 15%.

solcore.light_source.spectral2.calculate_spectrum_spectral2(stateObject=None, suppress_nan=True, power_density_in_nm=False)[source]

Calculates a solar spectrum using the SPECTRAL2 irradiance model developed by the NRL:

http://rredc.nrel.gov/solar/models/spectral/SPCTRAL2/

Parameters:
  • stateObject
  • suppress_nan
Returns: