Mie#

Linearized Mie#

class sasktran2.mie.LinearizedMie(self: sasktran2._core.LinearizedMie)#

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.

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]

Output Data structures#

class sasktran2.mie.MieOutput#

Bases: pybind11_object

property cos_angles#

Array containing the cosine of the scattering angles. Shape (angle).

property refractive_index#

Complex refractive index of spheres.

property size_parameter#

Array containing size parameters of spheres (2pi*radius/wavelength). Shape (size).

property values#

MieData structure containing Extinction Efficiency, Scattering Efficiency and Scattering Amplitudes.

class sasktran2.mie.MieData#

Bases: pybind11_object

property Qext#

Calculated Extinction Efficiency factor [unitless] for given size parameters and refractive index. Shape (size).

property Qsca#

Calculated Scattering Efficiency factor [unitless] for given size parameters and refractive index. Shape (size).

property S1#

Calculated Complex Scattering Amplitude [unitless] in first direction of incident polarization for given size parameters, cos(scattering angles) and refractive index. Shape (size, angle).

property S2#

Calculated Complex Scattering Amplitude [unitless] in second direction of incident polarization for given size parameters, cos(scattering angles) and refractive index. Shape (size, angle).

Particle Size Distributions#

class sasktran2.mie.distribution.ParticleSizeDistribution(identifier: str)[source]#

Bases: ABC

Abstract class to define particle size distributions that Mie parameters can be integrated over. This class is a light wrapper on top of scipy.stats.rv_continuous which adds some additional information.

Parameters:

identifier (str) – A unique identifier for the distribution

abstract args()[source]#

A list of arguments that are required to define this distribution when calling distribution

abstract distribution(**kwargs) rv_continuous[source]#

Returns back the scipy object representing this distribution

Return type:

rv_continuous

freeze(**kwargs)[source]#

Freeze some of the arguments of this distribution. E.g. if y is an argument of this distrubtion, calling freeze(y=5) will return a new distribution that is the same as this one, but with y frozen to 5.

Returns:

A new distribution with some of args frozen

Return type:

ParticleSizeDistribution

property identifier: str#

Get the unique identifier for this distribution

Return type:

str

class sasktran2.mie.distribution.LogNormalDistribution[source]#

Bases: ParticleSizeDistribution

A log normal particle size distribution, defined by two parameters, the median radius and mode width

args()[source]#

A list of arguments that are required to define this distribution when calling distribution

distribution(**kwargs)[source]#

Returns back the scipy object representing this distribution

Return type:

rv_continuous

Refractive Index Containers#

class sasktran2.mie.refractive.RefractiveIndex(refractive_index_fn: Callable[[float], complex], identifier: str)[source]#

Bases: object

A generic implementation of a refractive index function. This class is a light wrapper on top of a callable function that returns the complex refractive index for a given wavelength, as well as providing a unique identifier for the refractive index.

Parameters:
  • refractive_index_fn (Callable[[float], complex]) – Function that takes in a wavelength in nm and returns the complex refractive index

  • identifier (str) – A unique identifier for the refractive index

property identifier#

Get the unique identifier for this refractive index

refractive_index(wavelength_nm: ndarray) ndarray[source]#

Returns the complex refractive index for a given wavelength

Parameters:

wavelength_nm (np.ndarray)

Return type:

np.ndarray

property refractive_index_fn#

Get the function that returns the complex refractive index

class sasktran2.mie.refractive.H2SO4(source: str = 'osiris')[source]#

Bases: RefractiveIndex

A refractive index for H2SO4. The default source is the old OSIRIS data.

class sasktran2.mie.refractive.Ice(source: str = 'osiris')[source]#

Bases: RefractiveIndex

A refractive index for ice. The default source is the old OSIRIS data.

class sasktran2.mie.refractive.Water(source: str = 'osiris')[source]#

Bases: RefractiveIndex

A refractive index for Water. The default source is the old OSIRIS data.

class sasktran2.mie.refractive.Dust(source: str = 'osiris')[source]#

Bases: RefractiveIndex

A refractive index for Dust. The default source is the old OSIRIS data.