yasfpy.optics ============= .. py:module:: yasfpy.optics .. autoapi-nested-parse:: Optical post-processing for a :class:`~yasfpy.simulation.Simulation`. This module computes derived optical quantities such as total scattering/extinction cross sections and angular-resolved polarization components. Classes ------- .. autoapisummary:: yasfpy.optics.Optics Module Contents --------------- .. py:class:: Optics(simulation) The optics class handles the calculation of the optical scattering properties like scattering and extinction cross-sections. .. py:attribute:: simulation .. py:attribute:: c_ext .. py:attribute:: c_sca .. py:attribute:: log .. py:method:: 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. .. py:method:: compute_efficiencies() Compute dimensionless scattering/extinction efficiencies. .. rubric:: 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. .. py:method:: 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. :rtype: e_field_theta, e_field_phi .. py:method:: 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. :param legendre_coefficients_number: 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. :type legendre_coefficients_number: int, optional :param c_and_b: 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. :type c_and_b: Union[bool, tuple], optional .. py:method:: 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** .. py:method:: 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** .. py:method:: 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. .. py:method:: compute_double_henyey_greenstein(theta, cb) :staticmethod: Calculates the scattering phase function using the double Henyey-Greenstein model. :param theta: A numpy array representing the scattering angle. It contains the values at which you want to compute the double Henyey-Greenstein phase function. :type theta: np.ndarray :param cb: A numpy array that represents the coefficients of the double Henyey-Greenstein phase function. It should have a size of either 2 or 3. :type cb: np.ndarray :returns: Computed Henyey-Greenstein phase function. :rtype: p (np.ndarray) .. py:method:: compute_phase_function(legendre_coefficients_number = 15, c_and_b = False, check_phase_function = False) Generalized batching for phase function computation :param legendre_coefficients_number: 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. :type legendre_coefficients_number: int, optional :param c_and_b: 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. :type c_and_b: Union[bool, tuple], optional