frostie.utils ============= .. py:module:: frostie.utils Functions --------- .. autoapisummary:: frostie.utils.load_water_op_cons frostie.utils.load_co2_op_cons frostie.utils.spectra_list_match frostie.utils.wav_bins frostie.utils.find_nearest frostie.utils.Z_to_sigma Module Contents --------------- .. py:function:: 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. .. py:function:: 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. .. py:function:: 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. :param data_list: List of 1D arrays representing spectral data to be resampled. :type data_list: list of ndarray :param wav_list: Corresponding list of 1D wavelength arrays. :type wav_list: list of ndarray :returns: * **data_matched_list** (*list of ndarray*) -- Spectra resampled to the common wavelength grid. * **wav_common** (*ndarray*) -- Common wavelength axis used for resampling. .. py:function:: wav_bins(wav) Compute the wavelength bin edges for a given wavelength array. :param wav: Wavelength array. :type wav: ndarray :returns: **bins** -- Bin widths between consecutive wavelengths. :rtype: ndarray .. py:function:: 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. :param array: Array to search. :type array: ndarray :param value: Target value. :type value: float :returns: **index** -- Index of the closest array element. :rtype: int .. py:function:: Z_to_sigma(ln_Z1, ln_Z2) Convert log-evidences of two models to a sigma confidence level. :param ln_Z1: Log-evidence of full model. :type ln_Z1: float :param ln_Z2: Log-evidence of reduced model. :type ln_Z2: float :returns: * **B** (*float*) -- Bayes factor. * **sigma** (*float*) -- Sigma confidence level.