Sensitivity Information

The sensitivity code is heavily based on an original code by Stas Babak, Antoine Petiteau for the LDC team.

References for noise models:
lisatools.sensitivity.get_sensitivity(f, *args, sens_fn=<class 'lisatools.sensitivity.LISASens'>, return_type='PSD', **kwargs)[source]

Generic sensitivity generator

Same interface to many sensitivity curves.

Parameters:
  • f (float | ndarray) – Frequency array.

  • *args (tuple) – Any additional arguments for the sensitivity function get_Sn method.

  • sens_fn (Union[Sensitivity, str, None], default: <class 'lisatools.sensitivity.LISASens'>) – String or class that represents the name of the desired PSD function.

  • return_type (default: 'PSD') – Described the desired output. Choices are ASD, PSD, or char_strain (characteristic strain). Default is ASD.

  • **kwargs – Keyword arguments to pass to sensitivity function get_Sn method.

Return type:

float | ndarray

Returns:

Sensitivity values.

lisatools.sensitivity.get_stock_sensitivity_options()[source]

Get stock options for sensitivity curves.

Return type:

List[Sensitivity]

Returns:

List of stock sensitivity options.

lisatools.sensitivity.get_stock_sensitivity_matrix_options()[source]

Get stock options for sensitivity matrix.

Return type:

List[SensitivityMatrix]

Returns:

List of stock sensitivity matrix options.

Sensitivity Matrix

The sensitivity matrix is designed to house sensitivity information that will enter into the Likelihood function. It is a matrix because the 3 channels in LISA will be correlated. Therefore, in XYZ channels, this is a 3x3 matrix that includes correlated cross-terms between the channels. When working with AET channels (uncorrelated in idealized noise situations), then the sensitivity matrix will be an array of length 2 for AE or 3 for AET. The lisatools.diagnostic.inner_product() will adjust its computation based on the shape of the sensitivity matrix input. The user does not have to do anything special for this change to work. It happens under the hood.

class lisatools.sensitivity.SensitivityMatrix(f, sens_mat, *sens_args, **sens_kwargs)[source]

Bases: object

Container to hold sensitivity information.

Parameters:
property frequency_arr: ndarray
update_frequency_arr(frequency_arr)[source]

Update class with new frequency array.

Parameters:

frequency_arr (ndarray) – Frequency array.

Return type:

None

update_model(model)[source]

Update class with new sensitivity model.

Parameters:

model (LISAModel) – Noise model. Object of type lisa_models.LISAModel. It can also be a string corresponding to one of the stock models.

Return type:

None

update_stochastic(**kwargs)[source]

Update class with new stochastic function.

Parameters:

**kwargs (dict) – Keyword arguments update for lisatools.sensitivity.Sensitivity.get_stochastic_contribution(). This operation will combine the new and old kwarg dictionaries, updating any old information with any added corresponding new information. Note: any old information that is not updated will remain in place.

Return type:

None

property sens_mat: ndarray

Get sensitivity matrix.

property ndim: int

Dimensionality of sens mat array.

flatten()[source]

Flatten sens mat array.

Return type:

ndarray

property shape: tuple

Shape of sens mat array.

loglog(ax=None, fig=None, inds=None, char_strain=False, **kwargs)[source]

Produce a log-log plot of the sensitivity.

Parameters:
  • ax (Optional[Axes], default: None) – Matplotlib Axes objects to add plots. Either a list of Axes objects or a single Axes object.

  • fig (Optional[Figure], default: None) – Matplotlib figure object.

  • inds (Union[int, tuple, None], default: None) – Integer index to select out which data to add to a single access. A list can be provided if ax is a list. They must be the same length.

  • char_strain (Optional[bool], default: False) – If True, plot in characteristic strain representation. Note: assumes the sensitivity is input as power spectral density.

  • **kwargs (dict) – Keyword arguments to be passed to loglog function in matplotlib.

Return type:

Tuple[Figure, Axes]

Returns:

Matplotlib figure and axes objects in a 2-tuple.

Stock Sensitivity Matrices

class lisatools.sensitivity.XYZ1SensitivityMatrix(f, **sens_kwargs)[source]

Bases: SensitivityMatrix

Default sensitivity matrix for XYZ (TDI 1)

This is 3x3 symmetric matrix.

Parameters:
class lisatools.sensitivity.AET1SensitivityMatrix(f, **sens_kwargs)[source]

Bases: SensitivityMatrix

Default sensitivity matrix for AET (TDI 1)

This is just an array because no cross-terms.

Parameters:
class lisatools.sensitivity.AE1SensitivityMatrix(f, **sens_kwargs)[source]

Bases: SensitivityMatrix

Default sensitivity matrix for AE (no T) (TDI 1)

Parameters:
class lisatools.sensitivity.LISASensSensitivityMatrix(f, nchannels, **sens_kwargs)[source]

Bases: SensitivityMatrix

Default sensitivity matrix adding LISASens for the specified number of channels.

Parameters:
  • f (ndarray) – Frequency array.

  • nchannels (int) – Number of channels.

  • **sens_kwargs (dict) – Keyword arguments to pass to Sensitivity.get_Sn().

Sensitivity Base Class

class lisatools.sensitivity.Sensitivity[source]

Bases: ABC

Base Class for PSD information.

The initialization function is only needed if using a file input.

channel: str = None
static transform(f, Spm, Sop, **kwargs)[source]

Transform from the base sensitivity functions to the TDI PSDs.

Parameters:
  • f (float | ndarray) – Frequency array.

  • Spm (float | ndarray) – Acceleration term.

  • Sop (float | ndarray) – OMS term.

  • **kwargs (dict) – For interoperability.

Return type:

float | ndarray

Returns:

Transformed TDI PSD values.

classmethod get_Sn(f, model=LISAModel(Soms_d=2.25e-22, Sa_a=9e-30, orbits=<lisatools.detector.DefaultOrbits object>, name='scirdv1'), **kwargs)[source]

Calculate the PSD

Parameters:
  • f (float | ndarray) – Frequency array.

  • model (Union[LISAModel, str, None], default: LISAModel(Soms_d=2.25e-22, Sa_a=9e-30, orbits=<lisatools.detector.DefaultOrbits object at 0x1525caba0>, name='scirdv1')) –

    Noise model. Object of type lisa_models.LISAModel. It can also be a string corresponding to one of the stock models. The model object must include attributes for Soms_d (shot noise) and Sa_a (acceleration noise) or a spline as attribute Sn_spl. In the case of a spline, this must be a dictionary with channel names as keys and callable PSD splines. For example, if using scipy.interpolate.CubicSpline, an input option can be:

    ``` noise_model.Sn_spl = {

    ”A”: CubicSpline(f, Sn_A)), “E”: CubicSpline(f, Sn_E)), “T”: CubicSpline(f, Sn_T))

  • **kwargs (dict) – For interoperability.

Return type:

float | ndarray

Returns:

PSD values.

classmethod get_stochastic_contribution(f, stochastic_params=(), stochastic_kwargs={}, stochastic_function=None)[source]

Calculate contribution from stochastic signal.

This function directs and wraps the calculation of and returns the stochastic signal. The stochastic_function calculates the sensitivity contribution. The transform_factor can transform that output to the correct TDI contribution.

Parameters:
  • f (float | ndarray) – Frequency array.

  • stochastic_params (Optional[tuple], default: ()) – Parameters (arguments) to feed to stochastic_function.

  • stochastic_kwargs (Optional[dict], default: {}) – Keyword arguments to feeed to stochastic_function.

  • stochastic_function (Union[StochasticContribution, str, None], default: None) – Stochastic class or string name of stochastic class. Takes stochastic_args and stochastic_kwargs. If None, it uses FittedHyperbolicTangentGalacticForeground.

Return type:

float | ndarray

Returns:

Contribution from stochastic signal.

static stochastic_transform(f, Sh, **kwargs)[source]

Transform from the base stochastic functions to the TDI PSDs.

Note: If not implemented, the transform will return the input.

Parameters:
  • f (float | ndarray) – Frequency array.

  • Sh (float | ndarray) – Power spectral density in stochastic term.

  • **kwargs (dict) – For interoperability.

Return type:

float | ndarray

Returns:

Transformed TDI PSD values.

Stock Sensitivity Models

class lisatools.sensitivity.LISASens[source]

Bases: Sensitivity

classmethod get_Sn(f, model=LISAModel(Soms_d=2.25e-22, Sa_a=9e-30, orbits=<lisatools.detector.DefaultOrbits object>, name='scirdv1'), average=True, **kwargs)[source]

Compute the base LISA sensitivity function.

Parameters:
  • f (float | ndarray) – Frequency array.

  • model (Union[LISAModel, str, None], default: LISAModel(Soms_d=2.25e-22, Sa_a=9e-30, orbits=<lisatools.detector.DefaultOrbits object at 0x1525caba0>, name='scirdv1')) – Noise model. Object of type lisa_models.LISAModel. It can also be a string corresponding to one of the stock models.

  • average (bool, default: True) – Whether to apply averaging factors to sensitivity curve. Antenna response: av_resp = np.sqrt(5) if average else 1.0 Projection effect: Proj = 2.0 / np.sqrt(3) if average else 1.0

  • **kwargs (dict) – Keyword arguments to pass to get_stochastic_contribution(). # TODO: fix

Return type:

float | ndarray

Returns:

Sensitivity array.

class lisatools.sensitivity.CornishLISASens[source]

Bases: LISASens

PSD from https://arxiv.org/pdf/1803.01944.pdf

Power Spectral Density for the LISA detector assuming it has been active for a year. I found an analytic version in one of Niel Cornish’s paper which he submitted to the arXiv in 2018. I evaluate the PSD at the frequency bins found in the signal FFT.

PSD obtained from: https://arxiv.org/pdf/1803.01944.pdf

static get_Sn(f, average=True, **kwargs)[source]

Compute the base LISA sensitivity function.

Parameters:
  • f (float | ndarray) – Frequency array.

  • model – Noise model. Object of type lisa_models.LISAModel. It can also be a string corresponding to one of the stock models.

  • average (bool, default: True) – Whether to apply averaging factors to sensitivity curve. Antenna response: av_resp = np.sqrt(5) if average else 1.0 Projection effect: Proj = 2.0 / np.sqrt(3) if average else 1.0

  • **kwargs (dict) – Keyword arguments to pass to get_stochastic_contribution(). # TODO: fix

Return type:

float | ndarray

Returns:

Sensitivity array.

class lisatools.sensitivity.FlatPSDFunction[source]

Bases: LISASens

White Noise PSD function.

static get_Sn(f, val, **kwargs)[source]

Compute the base LISA sensitivity function.

Parameters:
  • f (float | ndarray) – Frequency array.

  • model – Noise model. Object of type lisa_models.LISAModel. It can also be a string corresponding to one of the stock models.

  • average – Whether to apply averaging factors to sensitivity curve. Antenna response: av_resp = np.sqrt(5) if average else 1.0 Projection effect: Proj = 2.0 / np.sqrt(3) if average else 1.0

  • **kwargs (dict) – Keyword arguments to pass to get_stochastic_contribution(). # TODO: fix

Return type:

float | ndarray

Returns:

Sensitivity array.

class lisatools.sensitivity.X1TDISens[source]

Bases: Sensitivity

channel: str = 'X'
static transform(f, Spm, Sop, **kwargs)[source]

Transform from the base sensitivity functions to the TDI PSDs.

Parameters:
  • f (float | ndarray) – Frequency array.

  • Spm (float | ndarray) – Acceleration term.

  • Sop (float | ndarray) – OMS term.

  • **kwargs (dict) – For interoperability.

Return type:

float | ndarray

Returns:

Transformed TDI PSD values.

static stochastic_transform(f, Sh, **kwargs)[source]

Transform from the base stochastic functions to the TDI PSDs.

Note: If not implemented, the transform will return the input.

Parameters:
  • f (float | ndarray) – Frequency array.

  • Sh (float | ndarray) – Power spectral density in stochastic term.

  • **kwargs (dict) – For interoperability.

Return type:

float | ndarray

Returns:

Transformed TDI PSD values.

class lisatools.sensitivity.Y1TDISens[source]

Bases: X1TDISens

channel: str = 'Y'
class lisatools.sensitivity.Z1TDISens[source]

Bases: X1TDISens

channel: str = 'Z'
class lisatools.sensitivity.XY1TDISens[source]

Bases: Sensitivity

channel: str = 'XY'
static transform(f, Spm, Sop, **kwargs)[source]

Transform from the base sensitivity functions to the TDI PSDs.

Parameters:
  • f (float | ndarray) – Frequency array.

  • Spm (float | ndarray) – Acceleration term.

  • Sop (float | ndarray) – OMS term.

  • **kwargs (dict) – For interoperability.

Return type:

float | ndarray

Returns:

Transformed TDI PSD values.

static stochastic_transform(f, Sh, **kwargs)[source]

Transform from the base stochastic functions to the TDI PSDs.

Note: If not implemented, the transform will return the input.

Parameters:
  • f (float | ndarray) – Frequency array.

  • Sh (float | ndarray) – Power spectral density in stochastic term.

  • **kwargs (dict) – For interoperability.

Return type:

float | ndarray

Returns:

Transformed TDI PSD values.

class lisatools.sensitivity.YZ1TDISens[source]

Bases: XY1TDISens

channel: str = 'YZ'
class lisatools.sensitivity.ZX1TDISens[source]

Bases: XY1TDISens

channel: str = 'ZX'
class lisatools.sensitivity.A1TDISens[source]

Bases: Sensitivity

channel: str = 'A'
static transform(f, Spm, Sop, **kwargs)[source]

Transform from the base sensitivity functions to the TDI PSDs.

Parameters:
  • f (float | ndarray) – Frequency array.

  • Spm (float | ndarray) – Acceleration term.

  • Sop (float | ndarray) – OMS term.

  • **kwargs (dict) – For interoperability.

Return type:

float | ndarray

Returns:

Transformed TDI PSD values.

static stochastic_transform(f, Sh, **kwargs)[source]

Transform from the base stochastic functions to the TDI PSDs.

Note: If not implemented, the transform will return the input.

Parameters:
  • f (float | ndarray) – Frequency array.

  • Sh (float | ndarray) – Power spectral density in stochastic term.

  • **kwargs (dict) – For interoperability.

Return type:

float | ndarray

Returns:

Transformed TDI PSD values.

class lisatools.sensitivity.E1TDISens[source]

Bases: A1TDISens

channel: str = 'E'
class lisatools.sensitivity.T1TDISens[source]

Bases: Sensitivity

channel: str = 'T'
static transform(f, Spm, Sop, **kwargs)[source]

Transform from the base sensitivity functions to the TDI PSDs.

Parameters:
  • f (float | ndarray) – Frequency array.

  • Spm (float | ndarray) – Acceleration term.

  • Sop (float | ndarray) – OMS term.

  • **kwargs (dict) – For interoperability.

Return type:

float | ndarray

Returns:

Transformed TDI PSD values.

static stochastic_transform(f, Sh, **kwargs)[source]

Transform from the base stochastic functions to the TDI PSDs.

Note: If not implemented, the transform will return the input.

Parameters:
  • f (float | ndarray) – Frequency array.

  • Sh (float | ndarray) – Power spectral density in stochastic term.

  • **kwargs (dict) – For interoperability.

Return type:

float | ndarray

Returns:

Transformed TDI PSD values.

class lisatools.sensitivity.X2TDISens[source]

Bases: Sensitivity

channel: str = 'X'
static transform(f, Spm, Sop, **kwargs)[source]

Transform from the base sensitivity functions to the TDI PSDs.

Parameters:
  • f (float | ndarray) – Frequency array.

  • Spm (float | ndarray) – Acceleration term.

  • Sop (float | ndarray) – OMS term.

  • **kwargs (dict) – For interoperability.

Return type:

float | ndarray

Returns:

Transformed TDI PSD values.

static stochastic_transform(f, Sh, **kwargs)[source]

Transform from the base stochastic functions to the TDI PSDs.

Note: If not implemented, the transform will return the input.

Parameters:
  • f (float | ndarray) – Frequency array.

  • Sh (float | ndarray) – Power spectral density in stochastic term.

  • **kwargs (dict) – For interoperability.

Return type:

float | ndarray

Returns:

Transformed TDI PSD values.

class lisatools.sensitivity.Y2TDISens[source]

Bases: X2TDISens

channel: str = 'Y'
class lisatools.sensitivity.Z2TDISens[source]

Bases: X2TDISens

channel: str = 'Z'