mtpy.analysis package

Submodules

mtpy.analysis.residual_phase_tensor module

Created on Wed Feb 22 14:13:57 2023

@author: jpeacock

class mtpy.analysis.residual_phase_tensor.ResidualPhaseTensor(pt_object1: PhaseTensor | None = None, pt_object2: PhaseTensor | None = None, residual_type: str = 'heise')[source]

Bases: object

Residual Phase Tensor class.

Generates a residual phase tensor (PT) object DeltaPhi calculated as: - Heise method: DeltaPhi = I - 0.5 * (Phi1^-1 * Phi2 + Phi2 * Phi1^-1) - Booker method: DeltaPhi = Phi1 - Phi2

residual_pt

Phase tensor object containing the residual phase tensor

Type:

PhaseTensor

rpt

Residual phase tensor array

Type:

np.ndarray

rpt_error

Error array for residual phase tensor

Type:

np.ndarray

pt1

First phase tensor object

Type:

PhaseTensor

pt2

Second phase tensor object

Type:

PhaseTensor

pt1_error

Error array for first phase tensor

Type:

np.ndarray

pt2_error

Error array for second phase tensor

Type:

np.ndarray

frequency

Frequency array

Type:

np.ndarray

residual_type

Type of residual calculation (‘heise’ or ‘booker’)

Type:

str

compute_residual_pt() None[source]

Compute residual phase tensor from two PhaseTensor objects.

Updates the following attributes: - rpt: residual phase tensor array - rpt_error: error array for residual phase tensor - residual_pt: PhaseTensor object containing residual

Raises:
  • ValueError – If phase tensor arrays have invalid data types

  • TypeError – If phase tensor arrays have incompatible shapes

Notes

Heise method calculates:

RPT = I - 0.5 * (PT1^-1 * PT2 + PT2 * PT1^-1)

Booker method calculates:

RPT = PT1 - PT2

read_pts(pt1: ndarray, pt2: ndarray, pt1_error: ndarray | None = None, pt2error: ndarray | None = None) None[source]

Read two phase tensor arrays and calculate the residual phase tensor.

Parameters:
  • pt1 (np.ndarray) – First phase tensor array

  • pt2 (np.ndarray) – Second phase tensor array

  • pt1_error (np.ndarray | None, optional) – Error array for first phase tensor, by default None

  • pt2error (np.ndarray | None, optional) – Error array for second phase tensor, by default None

Raises:

TypeError – If PT arrays have incompatible shapes

set_rpt(rpt_array: ndarray) None[source]

Set the residual phase tensor array attribute.

Parameters:

rpt_array (np.ndarray) – Residual phase tensor array

Notes

Tests for shape compatibility but does not test for consistency. Creates a new PhaseTensor object with the provided array.

set_rpt_error(rpt_error_array: ndarray) None[source]

Set the residual phase tensor error array attribute.

Parameters:

rpt_error_array (np.ndarray) – Residual phase tensor error array

Notes

Tests for shape compatibility but does not test for consistency. Creates a new PhaseTensor object with the provided error array.

Module contents

Created on Wed Feb 22 14:13:28 2023

@author: jpeacock