frostie.utils¶
Functions¶
|
Load water ice optical constants included in FROSTIE. |
|
Load carbon dioxide ice optical constants included in FROSTIE. |
|
Resample all input spectra to a common wavelength axis. |
|
Compute the wavelength bin edges for a given wavelength array. |
|
Find the index of the array element closest to the supplied value. |
|
Convert log-evidences of two models to a sigma confidence level. |
Module Contents¶
- frostie.utils.load_water_op_cons(wav_low=None, wav_high=None)¶
Load water ice optical constants included in FROSTIE.
- Returns:
wav (ndarray) – Wavelength array in microns.
n (ndarray) – Real part of the refractive index.
k (ndarray) – Imaginary part of the refractive index.
- frostie.utils.load_co2_op_cons(wav_low=None, wav_high=None)¶
Load carbon dioxide ice optical constants included in FROSTIE.
- Returns:
wav (ndarray) – Wavelength array in microns.
n (ndarray) – Real part of the refractive index.
k (ndarray) – Imaginary part of the refractive index.
- frostie.utils.spectra_list_match(data_list, wav_list)¶
Resample all input spectra to a common wavelength axis.
The common axis is chosen as the lowest-resolution wavelength array in the list.
- Parameters:
data_list (list of ndarray) – List of 1D arrays representing spectral data to be resampled.
wav_list (list of ndarray) – Corresponding list of 1D wavelength arrays.
- Returns:
data_matched_list (list of ndarray) – Spectra resampled to the common wavelength grid.
wav_common (ndarray) – Common wavelength axis used for resampling.
- frostie.utils.wav_bins(wav)¶
Compute the wavelength bin edges for a given wavelength array.
- Parameters:
wav (ndarray) – Wavelength array.
- Returns:
bins – Bin widths between consecutive wavelengths.
- Return type:
ndarray
- frostie.utils.find_nearest(array, value)¶
Find the index of the array element closest to the supplied value.
If multiple elements are equally close, the first match is returned.
- Parameters:
array (ndarray) – Array to search.
value (float) – Target value.
- Returns:
index – Index of the closest array element.
- Return type:
int
- frostie.utils.Z_to_sigma(ln_Z1, ln_Z2)¶
Convert log-evidences of two models to a sigma confidence level.
- Parameters:
ln_Z1 (float) – Log-evidence of full model.
ln_Z2 (float) – Log-evidence of reduced model.
- Returns:
B (float) – Bayes factor.
sigma (float) – Sigma confidence level.