sasktran2.mie.LinearizedMie#

class sasktran2.mie.LinearizedMie(self: sasktran2._core.LinearizedMie, num_threads: int = 1)#

Bases: pybind11_object

A Mie object created with no input parameters.

Standard usage is to create a Mie object, and then calculate mie parameters using calculate method.

Parameters:

num_threads (int) – Number of threads to use for the Mie calculation. Default is 1.

__init__(self: sasktran2._core.LinearizedMie, num_threads: int = 1) None#

A Mie object created with no input parameters.

Standard usage is to create a Mie object, and then calculate mie parameters using calculate method.

Parameters:

num_threads (int) – Number of threads to use for the Mie calculation. Default is 1.

Methods

__init__(self[, num_threads])

A Mie object created with no input parameters.

calculate(self, size_param, ...)

Performs the Mie computation for an array of size parameters, a single refractive index, and an array that is the cosine of the scattering angles.

calculate(self: sasktran2._core.LinearizedMie, size_param: numpy.ndarray[numpy.float64[m, 1]], refractive_index: complex, cos_angles: numpy.ndarray[numpy.float64[m, 1]], calculate_derivative: bool) sasktran2._core.MieOutput#

Performs the Mie computation for an array of size parameters, a single refractive index, and an array that is the cosine of the scattering angles.

Parameters:
  • size_param (np.ndarray) – Array of Mie size parameters. Shape (size).

  • refractive_index (complex) – Complex Mie refractive index

  • cos_angles (np.ndarray) – Array of cosine of angles to calculate the scattering amplitude at. Shape (angle).

  • calculate_derivative (bool, optional) – Optional parameter, initiates calculations of derivatives for size parameter and refractive index (not implemented at the moment), by default False

Returns:

MieOutput that contains the original size parameters, cosine of angles, and refractive index, as well as the calculated mie parameters.

Return type:

MieOutput

Examples

>>> import sasktran2 as sk
>>> import numpy as np
>>> mie = sk.mie.LinearizedMie()
>>> size_param = np.array([3.0, 4.0, 5.0])
>>> cos_angles = np.linspace(-1, 1, 100)
>>> refractive_index = 1.5 + 0.0j
>>> output = mie.calculate(size_param, refractive_index, cos_angles, True)
>>> print(output.values.Qext)
[3.41805617 4.05245221 3.92782673]
>>> print(output.values.Qsca)
[3.41805617 4.05245221 3.92782673]