Data / Residual / Signal Container
- class lisatools.datacontainer.DataResidualArray(data_res_in, dt=None, f_arr=None, df=None, **kwargs)[source]
Bases:
object
Container to hold Data, residual, or template information.
This class abstracts the connection with the sensitivity matrices to make this analysis as generic as possible for the user frontend, while handling special computations in the backend.
- Parameters:
data_res_in (
Union
[List
[ndarray
],ndarray
,DataResidualArray
]) – Data, residual, or template input information. Can be a list, numpy array or anotherDataResidualArray
.f_arr (
Optional
[ndarray
], default:None
) – Frequency array.df (
Optional
[float
], default:None
) – Delta f in frequency domain.**kwargs (
dict
) – For future compatibility.
- property fmax
Maximum frequency.
- property f_arr
Frequency array.
- property dt
Time step in seconds.
- property Tobs
Observation time in seconds
- property df
Delta f in the frequency domain.
- property frequency_arr: ndarray
Frequency array
- property data_res_arr: ndarray
Actual data residual array
- loglog(ax=None, fig=None, inds=None, char_strain=False, **kwargs)[source]
Produce a log-log plot of the data.
- Parameters:
ax (
Union
[List
[Axes
],Axes
,None
], 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
[List
[int
],int
,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
) – IfTrue
return plot in characteristic strain representation.**kwargs (
dict
) – Keyword arguments to be passed tologlog
function in matplotlib.
- Return type:
- Returns:
Matplotlib figure and axes objects in a 2-tuple.
- property char_strain: ndarray
Characteristic strain representation of the data.
Analysis Container
- class lisatools.analysiscontainer.AnalysisContainer(data_res_arr, sens_mat, signal_gen=None)[source]
Bases:
object
Combinatorial container that combines sensitivity and data information.
- Parameters:
data_res_arr (
DataResidualArray
) – Data / Residual / Signal array.sens_mat (
SensitivityMatrix
) – Sensitivity information.signal_gen (
Optional
[callable
], default:None
) – Callable object that takes information through*args
and**kwargs
and generates a signal in the proper channel setup employed indata_res_arr
andsens_mat
.
- property data_res_arr: DataResidualArray
Data information.
- property sens_mat: SensitivityMatrix
Sensitivity information.
- property signal_gen: callable
Signal generator.
- template_inner_product(template, **kwargs)[source]
Calculate the inner product of a template with the data.
- Parameters:
template (
DataResidualArray
) – Template signal.**kwargs (
dict
) – Keyword arguments to pass tolisatools.diagnostic.inner_product()
.
- Return type:
- Returns:
Inner product value.
- template_snr(template, phase_maximize=False, **kwargs)[source]
Calculate the SNR of a template, both optimal and detected.
- Parameters:
template (
DataResidualArray
) – Template signal.phase_maximize (
bool
, default:False
) – IfTrue
, maximize over an overall phase.**kwargs (
dict
) – Keyword arguments to pass tolisatools.diagnostic.inner_product()
.
- Return type:
- Returns:
(optimal snr, detected snr)
.
- template_likelihood(template, include_psd_info=False, phase_maximize=False, **kwargs)[source]
Calculate the Likelihood of a template against the data.
- Parameters:
template (
DataResidualArray
) – Template signal.include_psd_info (
bool
, default:False
) – IfTrue
, add the PSD term to the Likelihood value.phase_maximize (
bool
, default:False
) – IfTrue
, maximize over an overall phase.**kwargs (
dict
) – Keyword arguments to pass tolisatools.diagnostic.inner_product()
.
- Return type:
- Returns:
Likelihood value.
- likelihood(source_only=False, noise_only=False, **kwargs)[source]
Return the likelihood of the current arangement.
- Parameters:
source_only (
bool
, default:False
) – IfTrue
return the source-only Likelihood.noise_only (
bool
, default:False
) – IfTrue
, return the noise part of the Likelihood alone.**kwargs (
dict
) – Keyword arguments to pass tolisatools.diagnostic.inner_product()
.
- Return type:
- Returns:
Likelihood value.
- calculate_signal_likelihood(*args, source_only=False, waveform_kwargs={}, data_res_arr_kwargs={}, **kwargs)[source]
Return the likelihood of a generated signal with the data.
- Parameters:
params – Arguments to waveform generating function. Must include parameters.
source_only (
bool
, default:False
) – IfTrue
return the source-only Likelihood (leave out noise part).waveform_kwargs (
Optional
[dict
], default:{}
) – Keyword arguments to pass to waveform generator.data_res_arr_kwargs (
Optional
[dict
], default:{}
) – Keyword arguments for instantiation ofDataResidualArray
. This can be used if any transforms are desired prior to the Likelihood computation.**kwargs (
dict
) – Keyword arguments to pass tolisatools.diagnostic.inner_product()
- Return type:
- Returns:
Likelihood value.
- calculate_signal_inner_product(*args, source_only=False, waveform_kwargs={}, data_res_arr_kwargs={}, **kwargs)[source]
Return the inner product of a generated signal with the data.
- Parameters:
*args (
Any
) – Arguments to waveform generating function. Must include parameters.source_only (
bool
, default:False
) – IfTrue
return the source-only Likelihood (leave out noise part).waveform_kwargs (
Optional
[dict
], default:{}
) – Keyword arguments to pass to waveform generator.data_res_arr_kwargs (
Optional
[dict
], default:{}
) – Keyword arguments for instantiation ofDataResidualArray
. This can be used if any transforms are desired prior to the Likelihood computation.**kwargs (
dict
) – Keyword arguments to pass tolisatools.diagnostic.inner_product()
- Return type:
- Returns:
Inner product value.
- calculate_signal_snr(*args, source_only=False, waveform_kwargs={}, data_res_arr_kwargs={}, **kwargs)[source]
Return the SNR of a generated signal with the data.
- Parameters:
*args (
Any
) – Arguments to waveform generating function. Must include parameters.source_only (
bool
, default:False
) – IfTrue
return the source-only Likelihood (leave out noise part).waveform_kwargs (
Optional
[dict
], default:{}
) – Keyword arguments to pass to waveform generator.data_res_arr_kwargs (
Optional
[dict
], default:{}
) – Keyword arguments for instantiation ofDataResidualArray
. This can be used if any transforms are desired prior to the Likelihood computation.**kwargs (
dict
) – Keyword arguments to pass tolisatools.diagnostic.inner_product()
- Return type:
- Returns:
Snr values (optimal, detected).