frostie.hapke ============= .. py:module:: frostie.hapke Classes ------- .. autoapisummary:: frostie.hapke.regolith Functions --------- .. autoapisummary:: frostie.hapke.get_w frostie.hapke.get_b frostie.hapke.get_c frostie.hapke.get_p frostie.hapke.get_r frostie.hapke.get_H frostie.hapke.get_Q_s frostie.hapke.get_del_Q_s frostie.hapke.get_mrp_spectrum frostie.hapke.get_w_mix frostie.hapke.get_p_mix Module Contents --------------- .. py:class:: regolith Class to set up a 'regolith' made of one or more components and calculate it's reflectance. .. py:attribute:: components :value: [] .. py:attribute:: constant_D :value: True .. py:method:: add_components(component_list, matched_axes=False) Add a list of components (e.g., ice species) to the regolith. :param comp_list: Each dictionary should contain the keys 'name', 'wav', 'n', 'k', 'D', 'f', and optionally 'p_type'. :type comp_list: list of dict :param matched_axes: If True, assumes all components share a common wavelength axis. If False, wavelengths are interpolated as needed. :type matched_axes: bool, optional .. py:method:: set_obs_geometry(i, e, g) Set the observation geometry of the model. :param i: Incidence angle in degrees. :type i: float :param e: Emergence angle in degrees. :type e: float :param g: Phase angle in degrees. :type g: float .. py:property:: i Incidence angle in degrees. .. py:property:: mu_0 Cosine of the incidence angle. .. py:property:: e Emergence angle in degrees. .. py:property:: mu Cosine of the emergence angle. .. py:method:: set_porosity(p) .. py:property:: porosity Set the porosity of the regolith. :param p: Porosity value between 0 and 1. :type p: float .. py:property:: phi Packing angle phi derived from porosity. .. py:property:: K Compaction factor K computed from phi (packing angle). .. py:method:: set_backscattering(B) Set the backscattering amplitude in the Hapke model. :param B: Backscattering coefficient (typically between 0 and 1). :type B: float .. py:method:: set_s(s) Set the internal scattering coefficient. :param s: Internal scattering coefficient (in cm⁻¹). :type s: float .. py:method:: set_mixing_mode(mixing_mode) Set the type of mixing to use for the regolith. :param mode: Either 'intimate' or 'linear'. :type mode: str .. py:method:: _calculate_w(n, k, wav, D, s, Q_E=1.0) .. py:method:: _calculate_b(n, k, wav, D, s) .. py:method:: _calculate_c(n, k, wav, D, s) .. py:method:: _calculate_p(g, type='HG2', **kwags) .. py:method:: _calculate_r_one_comp() .. py:method:: calculate_reflectance(constant_D=True) Compute the reflectance spectrum of the regolith using Hapke theory. This method combines all current settings (components, geometry, porosity, mixing mode, etc.) to produce the final modeled reflectance. .. py:function:: get_w(n, k, wav, D, s, constant_D, Q_E=1.0) Function to calculate the single scattering albedo, w for a particle. Based on Bruce Hapke's model as implemented in his 2012 book. NOTE: We are assuming that diffraction is negligible so that Q_S = Q_s :param n: spectrum of n, the real part of refractive index :type n: 1D numpy float array :param k: spectrum of k, the imaginary part of refractive index :type k: 1D numpy float array :param wav: the common wavelength axis for n and k in microns. :type wav: 1D numpy float array :param D: mean particle diameter in microns :type D: float :param s: internal scattering coefficient inside the particle :type s: float :param Q_E: volume-average extinction efficiency :type Q_E: float :param constant_D: if False, get_mrp function is used :type constant_D: Boolean :param Unused parameters removed for now: :param alt_defn: if True, alternate definition for S_e and S_i will be used (eg. Lapotre et al. (2017)) :type alt_defn: Boolean :param mrp_spectrum: flag to calculate mean ray path length spectrum instead of a constant value :type mrp_spectrum: Boolean :returns: **w** -- spectrum of the single scattering albedo :rtype: 1D numpy float array .. py:function:: get_b(n, k, wav, D, s, constant_D) Function to calculate the b parameter for the two-parameter Henyey-Greenstein function, in the equivalent-slab approximation. Based on Bruce Hapke's model as implemented in his 2012 book. :param n: spectrum of n, the real part of refractive index :type n: 1D numpy float array :param k: spectrum of k, the imaginary part of refractive index :type k: 1D numpy float array :param wav: the common wavelength axis for n and k in microns. :type wav: 1D numpy float array :param D: mean particle diameter in microns :type D: float :param s: internal scattering coefficient inside the particle :type s: float :param constant_D: if False, get_mrp function is used :type constant_D: Boolean :returns: **b** -- spectrum of the parameter b :rtype: 1D numpy float array .. py:function:: get_c(n, k, wav, D, s, constant_D) Function to calculate the c parameter for the two-parameter Henyey-Greenstein function, in the equivalent-slab approximation. Based on Bruce Hapke's model as implemented in his 2012 book. :param n: spectrum of n, the real part of refractive index :type n: 1D numpy float array :param k: spectrum of k, the imaginary part of refractive index :type k: 1D numpy float array :param wav: the common wavelength axis for n and k in microns. :type wav: 1D numpy float array :param D: mean particle diameter in microns :type D: float :param s: internal scattering coefficient inside the particle :type s: float :param constant_D: if False, get_mrp function is used :type constant_D: Boolean :returns: **c** -- spectrum of the parameter c :rtype: 1D numpy float array .. py:function:: get_p(g, type='HG2', **kwags) Function to calculate the phase function value. The Henyey-Greenstien functions are from Pg. 104 of Hapke 2012. :param g: phase angle in degrees :type g: float :param type: type of phase function to use. Options are 'isotropic','Euler', 'HG1' (one parameter Henyey-Greenstein) and 'HG2' :type type: str :param \*\*kwargs: xi: float the cosine asymmetry factor for type='HG1' b: 1D numpy float array the cosine asymmetry factor for type='HG2' c: 1D numpy float array backscattering fraction for type='HG2' :type \*\*kwargs: additional arguments. .. py:function:: get_r(w, mu, mu_0, B, P, K=1.0) Function to calculate reflectance (radiance factor or I/F) as given by Hapke's model (Eq. 37 in Hapke 1981), which is also used by Lapotre et. al. 2017. :param w: average particle's single scattering albedo spectrum :type w: 1D numpy float array :param mu: cosine of emergence angle :type mu: float :param mu_0: cosine of incidence angle :type mu_0: float :param B: backscattering function value :type B: float :param P: phase function value :type P: float :param H: Chandrasekhar function value :type H: 1D numpy float array :param K: porosity coefficient (see eqn. 8.70 in Hapke 2012) :type K: float :returns: **r** -- reflectance or radiance factor spectrum :rtype: 1D numpy float array .. py:function:: get_H(w, x) Function to calculate Ambartsumian-Chandrasekhar H function (eq 8.56 from the book) :param w: single scattering albedo spectrum :type w: 1D numpy float array :param x: generic input variable, usually cosine of an angle :type x: float :returns: H function value :rtype: 1D numpy array .. py:function:: get_Q_s(n, k, wav, D, s, constant_D) Function to calculate the volume scattering efficiency (ignoring diffraction) in the equivalent-slab approximation. Based on Bruce Hapke's model as implemented in his 2012 book. :param n: spectrum of n, the real part of refractive index :type n: 1D numpy float array :param k: spectrum of k, the imaginary part of refractive index :type k: 1D numpy float array :param wav: the common wavelength axis for n and k in microns. :type wav: 1D numpy float array :param D: mean particle diameter in microns :type D: float :param s: internal scattering coefficient inside the particle :type s: float :param constant_D: if False, get_mrp function is used :type constant_D: Boolean :param Unused parameters removed for now: :param mrp_spectrum: flag to calculate mean ray path length spectrum instead of a constant value :type mrp_spectrum: Boolean :param alt_defn: if True, alternate definition for S_e and S_i will be used (eg. Lapotre et al. (2017)) :type alt_defn: Boolean :returns: **Q_s** -- spectrum of the volume scattering efficiency :rtype: 1D numpy float array .. py:function:: get_del_Q_s(n, k, wav, D, s, constant_D) Function to calculate the scattering efficiency difference in the equivalent-slab approximation. Based on Bruce Hapke's model as implemented in his 2012 book. :param n: spectrum of n, the real part of refractive index :type n: 1D numpy float array :param k: spectrum of k, the imaginary part of refractive index :type k: 1D numpy float array :param wav: the common wavelength axis for n and k in microns. :type wav: 1D numpy float array :param D: mean particle diameter in microns :type D: float :param s: internal scattering coefficient inside the particle :type s: float :param constant_D: if False, get_mrp function is used :type constant_D: Boolean :returns: **del_Q_s** -- spectrum of the scattering efficiency difference :rtype: 1D numpy float array .. py:function:: get_mrp_spectrum(n, D) Function the calculate the mean ray path length spectrum through the interior of a slab. (equivalent slab approximation). :param n: the real part of the refractive index as a function of wavelength :type n: 1D numpy array :param D: mean particle diameter :type D: float .. py:function:: get_w_mix(n_list, k_list, wav_common, D_list, f_list, s, constant_D, include_D=True) Function to calculate average single scattering albedo for a particulate mixture of two or more components. NOTE: this function requires all n and k arrays to be at the resolution of wav_common (use utils.spectra_list_match function) :param n_list: list of spectra of n, the real part of refractive index :type n_list: list of 1D numpy float arrays :param k_list: list of spectra of k, the imaginary part of refractive index :type k_list: list of 1D numpy float arrays :param wav_common: the common wavelength axis for all optical constants arrays :type wav_common: 1D numpy float array :param D_list: list of particle grain diameters in microns :type D_list: float :param f_list: list of number-density fractions :type f_list: list of float :param s: internal scattering coefficient inside the particle :type s: float :param constant_D: if False, get_mrp function is used :type constant_D: Boolean :param include_D: if True, grain size is included in weighted average calculation :type include_D: Boolean :returns: **w_mix** -- spectrum of the single scattering albedo :rtype: 1D numpy float array .. py:function:: get_p_mix(n_list, k_list, wav_common, D_list, f_list, p_type_list, g, s, constant_D) Function to calculate average phase function for a particulate mixture of two or more components. NOTE: this function requires all n and k arrays to be at the resolution of wav_common (use utils.spectra_list_match function) NOTE: We assume that Q_E=1 for all the components. :param n_list: list of spectra of n, the real part of refractive index :type n_list: list of 1D numpy float arrays :param k_list: list of spectra of k, the imaginary part of refractive index :type k_list: list of 1D numpy float arrays :param wav_common: the common wavelength axis for all optical constants arrays :type wav_common: 1D numpy float array :param D_list: list of particle grain diameters in microns :type D_list: float :param f_list: list of number-density fractions :type f_list: list of float :param p_type_list: list of function types for each component. Options are same as the get_p function: 'Euler', 'HG1' (one parameter Henyey-Greenstein) and 'HG2' :type p_type_list: list of str :param g: phase angle in degrees :type g: float :param s: internal scattering coefficient inside the particle :type s: float :param constant_D: if False, get_mrp function is used :type constant_D: Boolean :returns: **p_mix** -- spectrum of the phase function :rtype: 1D numpy float array