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:
‘Proposal’: LISA Consortium Proposal for L3 mission: LISA_L3_20170120 (https://atrium.in2p3.fr/13414ec1-c9ac-44b4-bace-7004468f684c)
‘SciRDv1’: Science Requirement Document: ESA-L3-EST-SCI-RS-001 14/05/2018 (https://atrium.in2p3.fr/f5a78d3e-9e19-47a5-aa11-51c81d370f5f)
‘MRDv1’: Mission Requirement Document: ESA-L3-EST-MIS-RS-001 08/12/2017
‘sangria’: Model used for LDC2A data generation.
- lisatools.sensitivity.get_sensitivity(f: float | ~numpy.ndarray, *args: tuple, sens_fn: ~lisatools.sensitivity.Sensitivity | str | None = <class 'lisatools.sensitivity.LISASens'>, return_type='PSD', fill_nans: float = 10000000000.0, **kwargs) float | ndarray
Generic sensitivity generator
Same interface to many sensitivity curves.
- Parameters:
f – Frequency array.
*args – Any additional arguments for the sensitivity function
get_Sn
method.sens_fn – String or class that represents the name of the desired PSD function.
return_type – Described the desired output. Choices are ASD, PSD, or char_strain (characteristic strain). Default is ASD.
fill_nans – Value to fill nans in sensitivity (at 0 frequency). If
None
, thens nans will be left in the array.**kwargs – Keyword arguments to pass to sensitivity function
get_Sn
method.
- Returns:
Sensitivity values.
- lisatools.sensitivity.get_stock_sensitivity_options() List[Sensitivity]
Get stock options for sensitivity curves.
- Returns:
List of stock sensitivity options.
- lisatools.sensitivity.get_stock_sensitivity_matrix_options() List[SensitivityMatrix]
Get stock options for sensitivity matrix.
- Returns:
List of stock sensitivity matrix options.
- lisatools.sensitivity.get_stock_sensitivity_from_str(sensitivity: str) Sensitivity
Return a LISA sensitivity from a
str
input.- Parameters:
sensitivity – Sensitivity indicated with a
str
.- Returns:
Sensitivity associated to that
str
.
- lisatools.sensitivity.check_sensitivity(sensitivity: Any) Sensitivity
Check input sensitivity.
- Parameters:
sensitivity – Sensitivity to check.
- Returns:
Sensitivity checked. Adjusted from
str
ifstr
input.
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: ndarray, sens_mat: List[List[ndarray | Sensitivity]] | List[ndarray | Sensitivity] | ndarray | Sensitivity, *sens_args: tuple, **sens_kwargs: dict)
Bases:
object
Container to hold sensitivity information.
- Parameters:
f – Frequency array.
sens_mat – Input sensitivity list. The shape of the nested lists should represent the shape of the desired matrix. Each entry in the list must be an array,
Sensitivity
-derived object, or a string corresponding to theSensitivity
object.**sens_kwargs – Keyword arguments to pass to
Sensitivity.get_Sn()
.
- update_frequency_arr(frequency_arr: ndarray) None
Update class with new frequency array.
- Parameters:
frequency_arr – Frequency array.
- update_model(model: LISAModel) None
Update class with new sensitivity model.
- Parameters:
model – Noise model. Object of type
lisa_models.LISAModel
. It can also be a string corresponding to one of the stock models.
- update_stochastic(**kwargs: dict) None
Update class with new stochastic function.
- Parameters:
**kwargs – 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.
- property sens_mat: ndarray
Get sensitivity matrix.
- property ndim: int
Dimensionality of sens mat array.
- flatten() ndarray
Flatten sens mat array.
- property shape: tuple
Shape of sens mat array.
- loglog(ax: Axes | None = None, fig: Figure | None = None, inds: int | tuple | None = None, char_strain: bool | None = False, **kwargs: dict) Tuple[Figure, Axes]
Produce a log-log plot of the sensitivity.
- Parameters:
ax – Matplotlib Axes objects to add plots. Either a list of Axes objects or a single Axes object.
fig – Matplotlib figure object.
inds – 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 – If
True
, plot in characteristic strain representation. Note: assumes the sensitivity is input as power spectral density.**kwargs – Keyword arguments to be passed to
loglog
function in matplotlib.
- Returns:
Matplotlib figure and axes objects in a 2-tuple.
Stock Sensitivity Matrices
- class lisatools.sensitivity.XYZ1SensitivityMatrix(f: ndarray, **sens_kwargs: dict)
Bases:
SensitivityMatrix
Default sensitivity matrix for XYZ (TDI 1)
This is 3x3 symmetric matrix.
- Parameters:
f – Frequency array.
**sens_kwargs – Keyword arguments to pass to
Sensitivity.get_Sn()
.
- class lisatools.sensitivity.AET1SensitivityMatrix(f: ndarray, **sens_kwargs: dict)
Bases:
SensitivityMatrix
Default sensitivity matrix for AET (TDI 1)
This is just an array because no cross-terms.
- Parameters:
f – Frequency array.
**sens_kwargs – Keyword arguments to pass to
Sensitivity.get_Sn()
.
- class lisatools.sensitivity.AE1SensitivityMatrix(f: ndarray, **sens_kwargs: dict)
Bases:
SensitivityMatrix
Default sensitivity matrix for AE (no T) (TDI 1)
- Parameters:
f – Frequency array.
**sens_kwargs – Keyword arguments to pass to
Sensitivity.get_Sn()
.
- class lisatools.sensitivity.LISASensSensitivityMatrix(f: ndarray, nchannels: int, **sens_kwargs: dict)
Bases:
SensitivityMatrix
Default sensitivity matrix adding
LISASens
for the specified number of channels.- Parameters:
f – Frequency array.
nchannels – Number of channels.
**sens_kwargs – Keyword arguments to pass to
Sensitivity.get_Sn()
.
Sensitivity Base Class
- class lisatools.sensitivity.Sensitivity
Bases:
ABC
Base Class for PSD information.
The initialization function is only needed if using a file input.
- static get_xp(array: ndarray) object
Numpy or Cupy (or float)
- static transform(f: float | ndarray, Spm: float | ndarray, Sop: float | ndarray, **kwargs: dict) float | ndarray
Transform from the base sensitivity functions to the TDI PSDs.
- Parameters:
f – Frequency array.
Spm – Acceleration term.
Sop – OMS term.
**kwargs – For interoperability.
- Returns:
Transformed TDI PSD values.
- classmethod get_Sn(f: float | ~numpy.ndarray, model: ~lisatools.detector.LISAModel | str | None = LISAModel(Soms_d=2.25e-22, Sa_a=9e-30, orbits=<lisatools.detector.DefaultOrbits object>, name='scirdv1'), **kwargs: dict) float | ndarray
Calculate the PSD
- Parameters:
f – Frequency array.
model –
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 forSoms_d
(shot noise) andSa_a
(acceleration noise) or a spline as attributeSn_spl
. In the case of a spline, this must be a dictionary with channel names as keys and callable PSD splines. For example, if usingscipy.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 – For interoperability.
- Returns:
PSD values.
- classmethod get_stochastic_contribution(f: float | ndarray, stochastic_params: tuple | None = (), stochastic_kwargs: dict | None = {}, stochastic_function: StochasticContribution | str | None = None) float | ndarray
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. Thetransform_factor
can transform that output to the correct TDI contribution.- Parameters:
f – Frequency array.
stochastic_params – Parameters (arguments) to feed to
stochastic_function
.stochastic_kwargs – Keyword arguments to feeed to
stochastic_function
.stochastic_function – Stochastic class or string name of stochastic class. Takes
stochastic_args
andstochastic_kwargs
. IfNone
, it usesFittedHyperbolicTangentGalacticForeground
.
- Returns:
Contribution from stochastic signal.
- static stochastic_transform(f: float | ndarray, Sh: float | ndarray, **kwargs: dict) float | ndarray
Transform from the base stochastic functions to the TDI PSDs.
Note: If not implemented, the transform will return the input.
- Parameters:
f – Frequency array.
Sh – Power spectral density in stochastic term.
**kwargs – For interoperability.
- Returns:
Transformed TDI PSD values.
Stock Sensitivity Models
- class lisatools.sensitivity.LISASens
Bases:
Sensitivity
- classmethod get_Sn(f: float | ~numpy.ndarray, model: ~lisatools.detector.LISAModel | str | None = LISAModel(Soms_d=2.25e-22, Sa_a=9e-30, orbits=<lisatools.detector.DefaultOrbits object>, name='scirdv1'), average: bool = True, **kwargs: dict) float | ndarray
Compute the base LISA sensitivity function.
- Parameters:
f – 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 – Keyword arguments to pass to
get_stochastic_contribution()
. # TODO: fix
- Returns:
Sensitivity array.
- class lisatools.sensitivity.CornishLISASens
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: float | ndarray, average: bool = True, **kwargs: dict) float | ndarray
Compute the base LISA sensitivity function.
- Parameters:
f – 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 – Keyword arguments to pass to
get_stochastic_contribution()
. # TODO: fix
- Returns:
Sensitivity array.
- class lisatools.sensitivity.FlatPSDFunction
Bases:
LISASens
White Noise PSD function.
- classmethod get_Sn(f: float | ndarray, val: float, **kwargs: dict) float | ndarray
Compute the base LISA sensitivity function.
- Parameters:
f – 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 – Keyword arguments to pass to
get_stochastic_contribution()
. # TODO: fix
- Returns:
Sensitivity array.
- class lisatools.sensitivity.X1TDISens
Bases:
Sensitivity
- static transform(f: float | ndarray, Spm: float | ndarray, Sop: float | ndarray, **kwargs: dict) float | ndarray
Transform from the base sensitivity functions to the TDI PSDs.
- Parameters:
f – Frequency array.
Spm – Acceleration term.
Sop – OMS term.
**kwargs – For interoperability.
- Returns:
Transformed TDI PSD values.
- static stochastic_transform(f: float | ndarray, Sh: float | ndarray, **kwargs: dict) float | ndarray
Transform from the base stochastic functions to the TDI PSDs.
Note: If not implemented, the transform will return the input.
- Parameters:
f – Frequency array.
Sh – Power spectral density in stochastic term.
**kwargs – For interoperability.
- Returns:
Transformed TDI PSD values.
- class lisatools.sensitivity.XY1TDISens
Bases:
Sensitivity
- static transform(f: float | ndarray, Spm: float | ndarray, Sop: float | ndarray, **kwargs: dict) float | ndarray
Transform from the base sensitivity functions to the TDI PSDs.
- Parameters:
f – Frequency array.
Spm – Acceleration term.
Sop – OMS term.
**kwargs – For interoperability.
- Returns:
Transformed TDI PSD values.
- static stochastic_transform(f: float | ndarray, Sh: float | ndarray, **kwargs: dict) float | ndarray
Transform from the base stochastic functions to the TDI PSDs.
Note: If not implemented, the transform will return the input.
- Parameters:
f – Frequency array.
Sh – Power spectral density in stochastic term.
**kwargs – For interoperability.
- Returns:
Transformed TDI PSD values.
- class lisatools.sensitivity.YZ1TDISens
Bases:
XY1TDISens
- class lisatools.sensitivity.ZX1TDISens
Bases:
XY1TDISens
- class lisatools.sensitivity.A1TDISens
Bases:
Sensitivity
- static transform(f: float | ndarray, Spm: float | ndarray, Sop: float | ndarray, **kwargs: dict) float | ndarray
Transform from the base sensitivity functions to the TDI PSDs.
- Parameters:
f – Frequency array.
Spm – Acceleration term.
Sop – OMS term.
**kwargs – For interoperability.
- Returns:
Transformed TDI PSD values.
- static stochastic_transform(f: float | ndarray, Sh: float | ndarray, **kwargs: dict) float | ndarray
Transform from the base stochastic functions to the TDI PSDs.
Note: If not implemented, the transform will return the input.
- Parameters:
f – Frequency array.
Sh – Power spectral density in stochastic term.
**kwargs – For interoperability.
- Returns:
Transformed TDI PSD values.
- class lisatools.sensitivity.T1TDISens
Bases:
Sensitivity
- static transform(f: float | ndarray, Spm: float | ndarray, Sop: float | ndarray, **kwargs: dict) float | ndarray
Transform from the base sensitivity functions to the TDI PSDs.
- Parameters:
f – Frequency array.
Spm – Acceleration term.
Sop – OMS term.
**kwargs – For interoperability.
- Returns:
Transformed TDI PSD values.
- static stochastic_transform(f: float | ndarray, Sh: float | ndarray, **kwargs: dict) float | ndarray
Transform from the base stochastic functions to the TDI PSDs.
Note: If not implemented, the transform will return the input.
- Parameters:
f – Frequency array.
Sh – Power spectral density in stochastic term.
**kwargs – For interoperability.
- Returns:
Transformed TDI PSD values.
- class lisatools.sensitivity.X2TDISens
Bases:
Sensitivity
- static transform(f: float | ndarray, Spm: float | ndarray, Sop: float | ndarray, **kwargs: dict) float | ndarray
Transform from the base sensitivity functions to the TDI PSDs.
- Parameters:
f – Frequency array.
Spm – Acceleration term.
Sop – OMS term.
**kwargs – For interoperability.
- Returns:
Transformed TDI PSD values.
- static stochastic_transform(f: float | ndarray, Sh: float | ndarray, **kwargs: dict) float | ndarray
Transform from the base stochastic functions to the TDI PSDs.
Note: If not implemented, the transform will return the input.
- Parameters:
f – Frequency array.
Sh – Power spectral density in stochastic term.
**kwargs – For interoperability.
- Returns:
Transformed TDI PSD values.