yasfpy.optics#

Optical post-processing for a Simulation.

This module computes derived optical quantities such as total scattering/extinction cross sections and angular-resolved polarization components.

Classes#

Optics

The optics class handles the calculation of the optical scattering properties

Module Contents#

class yasfpy.optics.Optics(simulation)#

The optics class handles the calculation of the optical scattering properties like scattering and extinction cross-sections.

simulation#
c_ext#
c_sca#
log#
compute_cross_sections()#

Compute the scattering and extinction cross sections.

This method calculates the scattering and extinction cross sections for the simulation. It uses the initial field coefficients and scattered field coefficients to perform the calculations.

compute_efficiencies()#

Compute dimensionless scattering/extinction efficiencies.

Notes

Efficiencies are computed by dividing the cross sections by the geometric projection of the particle cluster and applying the medium refractive index scaling used by the project.

compute_scattered_e_field_angle_components()#

Compute scattered E-field components in spherical-angle coordinates.

Returns:

Arrays holding the complex scattered electric field components along theta and phi directions on the simulation sampling grid.

Return type:

e_field_theta, e_field_phi

compute_phase_funcition(legendre_coefficients_number=15, c_and_b=False, check_phase_function=False)#

The function compute_phase_function calculates various polarization components and phase function coefficients for a given simulation.

Parameters:
  • legendre_coefficients_number (int, optional) – The number of Legendre coefficients to compute for the phase function. These coefficients are used to approximate the phase function using Legendre polynomials. The higher the number of coefficients, the more accurate the approximation will be.

  • c_and_b (Union[bool, tuple], optional) – A boolean value or a tuple. If True, it indicates that the c and b bounds should be computed. If False, the function will return without computing the c and b bounds.

compute_asymmetry()#

Computes the asymmetry parameter by numerical integration over the phase function. Therefore depends on the chosen sampling points. Accuracy depends on the number of sampling points. ACCURACY CURRENTLY VERY MUCH IN QUESTION

compute_asymmetry_corrected()#

Computes asymmetry parameter via numerical integration over the phase function. Makes use of a correction term for the surface to compensate for underestimation of the spaces surface area. Therefore depends on the chosen sampling points. Accuracy depends on the number of sampling points. ACCURACY CURRENTLY VERY MUCH IN QUESTION

compute_asymmetry_coeff()#

WIP: Tried using the scattered field coefficients p & q to calculate the asymmetry parameter. Does not work. Might however be subject to further investigation, to achievce more reliable results.

static compute_double_henyey_greenstein(theta, cb)#

Calculates the scattering phase function using the double Henyey-Greenstein model.

Parameters:
  • theta (np.ndarray) – A numpy array representing the scattering angle. It contains the values at which you want to compute the double Henyey-Greenstein phase function.

  • cb (np.ndarray) – A numpy array that represents the coefficients of the double Henyey-Greenstein phase function. It should have a size of either 2 or 3.

Returns:

Computed Henyey-Greenstein phase function.

Return type:

p (np.ndarray)

compute_phase_function(legendre_coefficients_number=15, c_and_b=False, check_phase_function=False)#

Generalized batching for phase function computation

Parameters:
  • legendre_coefficients_number (int, optional) – The number of Legendre coefficients to compute for the phase function. These coefficients are used to approximate the phase function using Legendre polynomials. The higher the number of coefficients, the more accurate the approximation will be.

  • c_and_b (Union[bool, tuple], optional) – A boolean value or a tuple. If True, it indicates that the c and b bounds should be computed. If False, the function will return without computing the c and b bounds.