katsu.mueller module
- katsu.mueller.decompose_depolarizer(M, return_all=False)
Decompose M into a depolarizer using the Polar decomposition
from Lu & Chipman 1996 https://doi.org/10.1364/JOSAA.13.001106
- Parameters:
M (numpy.ndarray) – Mueller Matrix to decompose
- return_allbool
Whether to return the depolaarizer, retarder and diattenuator vs just the retarder. Defaults to False, which returns just the depolarizer
- Returns:
Decomposed mueller matrix
- Return type:
numpy.ndarray or arrays
- katsu.mueller.decompose_diattenuator(M, normalize=False)
Decompose M into a diattenuator using the Polar decomposition
from Lu & Chipman 1996 https://doi.org/10.1364/JOSAA.13.001106
- Parameters:
M (numpy.ndarray) – Mueller Matrix to decompose
- Returns:
Diattenuator component of mueller matrix
- Return type:
numpy.ndarray
- katsu.mueller.decompose_retarder(M, return_all=False, normalize=False)
Decompose M into a retarder using the Polar decomposition
from Lu & Chipman 1996 https://doi.org/10.1364/JOSAA.13.001106
Note: this doesn’t work if the diattenuation can be described by a pure polarizer, because the matrix is singular and therefore non-invertible
- Parameters:
M (numpy.ndarray) – Mueller Matrix to decompose
return_all (bool) – Whether to return the retarder and diattenuator vs just the retarder. Defaults to False, which returns both
- Returns:
Retarder component of mueller matrix
- Return type:
numpy.ndarray
- katsu.mueller.depolarization_index(Md)
compute the depolarization index from a Mueller Matrix
Eq. 6.79 in CLY
- Parameters:
Md (numpy.ndarray) – depolarizer to compute the DI of
- Returns:
depolarization index
- Return type:
numpy.ndarray
- katsu.mueller.depolarizer(angle, a, b, c, shape=None)
returns a diagonal depolarizer
- Parameters:
angle (float, or numpy.ndarray) – angle of the transmission axis w.r.t. horizontal in radians. If numpy array, must be the same shape as shape
a (float or numpy.ndarray) – depolarization of Q
b (float or numpy.ndarray) – depolarization of U
c (float or numpy.ndarray) – depolarization of V
shape (list, optional) – shape to prepend to the mueller matrix array, see _empty_mueller. By default None
- Returns:
depolarizer Mueller matrix
- Return type:
numpy.ndarray
- katsu.mueller.diattenuation_from_mueller(M)
compute the total diattenuation from a Mueller matrix
Eq. 6.21 in CLY
- Parameters:
M (numpy.ndarray) – array containing Mueller matrices in the last two dimensions
- Returns:
diattenuation of the Mueller matrices
- Return type:
numpy.ndarray
- katsu.mueller.diattenuation_parameters_from_mueller(M)
compute diattenuation decomposed into horizontal, +45, and circular parameters
- Parameters:
M (numpy.ndarray) – array containing Mueller matrices in the last two dimensions
- Returns:
arrays corresponding to horizontal, +45, and RC diattenuation
- Return type:
numpy.ndarray, numpy.ndarray, numpy.ndarray
- katsu.mueller.linear_diattenuator(a, Tmin, Tmax=1, shape=None)
returns a homogenous linear diattenuator
See Equation 6.54 in CLY
- Parameters:
a (float, or numpy.ndarray) – angle of the transmission axis w.r.t. horizontal in radians. If numpy array, must be the same shape as shape
Tmin (float, or numpy.ndarray) – Minimum transmission of the state orthogonal to maximum transmission. If numpy array, must be the same shape as shape
shape (list, optional) – shape to prepend to the mueller matrix array, see _empty_mueller. By default None
- Returns:
linear diattenuator array
- Return type:
numpy.ndarray
- katsu.mueller.linear_polarizer(a, shape=None)
returns a homogenous linear polarizer
- Parameters:
a (float, or numpy.darray) – angle of the transmission axis w.r.t. horizontal in radians. If numpy array, must be the same shape as shape
shape (list, optional) – shape to prepend to the mueller matrix array, see _empty_mueller. by default None
- Returns:
linear polarizer array
- Return type:
numpy.ndarray
- katsu.mueller.linear_retarder(a, r, shape=None)
returns a homogenous linear retarder
- Parameters:
a (float, or numpy.ndarray) – angle of the fast axis w.r.t. horizontal in radians. If numpy array, must be 1D
r (float, or numpy.ndarray) – retardance in radians. If numpy array, must be the same shape as shape
shape (list, optional) – shape to prepend to the mueller matrix array, see _empty_mueller. by default None
- Returns:
linear retarder array
- Return type:
numpy.ndarray
- katsu.mueller.mueller_rotation(angle, shape=None)
returns a Mueller rotation matrix
- Parameters:
angle (float, or numpy.darray) – angle of the rotation w.r.t. horizontal in radians. If numpy array, must be the same shape as shape
shape (list, optional) – shape to prepend to the mueller matrix array, see _empty_mueller. by default None
- Returns:
Mueller rotation matrix
- Return type:
numpy.ndarray
- katsu.mueller.mueller_to_jones(M)
Converts Mueller matrix to a relative Jones matrix. Phase aberration is relative to the Pxx component.
See Eq. 6.112 in CLY
- Returns:
J – Jones matrix from Mueller matrix calculation
- Return type:
2x2 ndarray
- katsu.mueller.retardance_from_mueller(M)
compute the total retardance from a Mueller matrix
Eq. 6.21 in CLY
- Parameters:
M (numpy.ndarray) – array containing Mueller matrices in the last two dimensions
- Returns:
retardance of the Mueller matrices
- Return type:
numpy.ndarray
- katsu.mueller.retardance_parameters_from_mueller(M, tol=1e-10)
compute the retardance decomposed into horizontal, +45, and circular parameters
Eq. 6.30 in CLY
TODO: Investigate if this is actually the correct order of parameters, I think that horizontal and right-circular might be flipped in the text. Here lies the version which passes the physical test in test_mueller.py, so I believe the textboook is wrong.
- Parameters:
M (numpy.ndarray) – array containing Mueller matrices in the last two dimensions
tol (float) – tolerance for considering the sin(retardance) to be zero. This is important for nearly half-wave pure retarders. Defaults to 1e-10.
- Returns:
arrays corresponding to horizontal, +45, and RC retardance
- Return type:
numpy.ndarray, numpy.ndarray, numpy.ndarray
- katsu.mueller.stokes_from_parameters(I, Q, U, V, shape=None)
Generates a stokes vector array from the stokes parameters
- Parameters:
I (float or numpy.ndarray) – Stokes parameter corresponding to intensity, must be float or numpy.ndarray with shape == shape
Q (float or numpy.ndarray) – Stokes parameter corresponding to H/V polarization, must be float or numpy.ndarray with shape == shape
U (float or numpy.ndarray) – Stokes parameter corresponding to +45/-45 polarization, must be float or numpy.ndarray with shape == shape
V (float or numpy.ndarray) – Stokes parameter corresponding to RHC/LHC polarization, must be float or numpy.ndarray with shape == shape
shape (list) – shape to prepend to the stokes array. shape = [32,32] returns an array of shape [32,32,4,1] where the vector is assumed to be in the last indices. Defaults to None, which returns a 4x1 array.
- Returns:
array of stokes vectors
- Return type:
numpy.ndarray
- katsu.mueller.wollaston(beam=0, rotation=0.0, shape=None)
Method to construct the Mueller matrix of a Wollaston, Functionally just a hand-hold wrapper for linear_polarizer
- Parameters:
beam (int, or str) – ‘Channel’ of wollaston prism, by default 0, which returns the Mueller matrix for the horizontally-polarized beam
rotation (float, optional) – Rotation of the Wollaston prism with respect to the laboratory’s horizontal axis, by default 0
shape (list, optional) – shape to prepend to the mueller matrix array, see _empty_mueller. By default None
- Returns:
Mueller matrix of the chosen linear polarizer channel
- Return type:
numpy.ndarray