jaxlayerlumos.utils_light_sources
Light source utilities for optical calculations.
This module provides functions for loading and interpolating light source spectra, including standard solar spectra (AM0, AM1.5G, AM1.5D) and other light sources. It handles wavelength-dependent irradiance data and provides interpolation to arbitrary wavelength ranges.
- jaxlayerlumos.utils_light_sources.get_irradiance(light_source, wavelength)
Get irradiance values for a light source at specified wavelengths.
This is a convenience function that loads and interpolates light source data to the target wavelengths.
- Parameters:
light_source (str) – Name of the light source.
wavelength (jnp.ndarray) – Target wavelengths in meters.
- Returns:
Irradiance values at the target wavelengths.
- Return type:
jnp.ndarray
- jaxlayerlumos.utils_light_sources.interpolate(wavelength, data_wavelength, data_irradiance)
Interpolate irradiance data to target wavelengths.
- Parameters:
wavelength (jnp.ndarray) – Target wavelengths for interpolation.
data_wavelength (jnp.ndarray) – Wavelengths of the source data.
data_irradiance (jnp.ndarray) – Irradiance values of the source data.
- Returns:
Interpolated irradiance values at the target wavelengths.
- Return type:
jnp.ndarray
- jaxlayerlumos.utils_light_sources.interpolate_light_source_irradiance(light_source, wavelength)
Interpolate a light source’s irradiance spectrum to target wavelengths.
- Parameters:
light_source (str) – Name of the light source.
wavelength (jnp.ndarray) – Target wavelengths in meters.
- Returns:
Interpolated irradiance values at the target wavelengths.
- Return type:
jnp.ndarray
- jaxlayerlumos.utils_light_sources.load_light_source_json()
Load the light source index file that maps light source names to CSV files.
- Returns:
- (light_source_indices, current_dir) where light_source_indices is a
dictionary mapping light source names to CSV filenames, and current_dir is the directory containing the light source data.
- Return type:
tuple
- jaxlayerlumos.utils_light_sources.load_light_source_wavelength(light_source)
Load light source data with wavelengths in meters.
This function loads light source data and converts wavelengths from nanometers to meters.
- Parameters:
light_source (str) – Name of the light source.
- Returns:
- (data_wavelength, data_irradiance) - Wavelengths in meters and
corresponding irradiance values.
- Return type:
tuple
- jaxlayerlumos.utils_light_sources.load_light_source_wavelength_nm(light_source)
Load light source data with wavelengths in nanometers.
This function reads the CSV file for the specified light source and extracts the wavelength-dependent irradiance data.
- Parameters:
light_source (str) – Name of the light source.
- Returns:
- (wavelength, irradiance) - Wavelengths in nanometers and
corresponding irradiance values.
- Return type:
tuple
- Raises:
ValueError – If the light source is not found in the database.