Stochastic Signals

Stochastic Base Class

class lisatools.stochastic.StochasticContribution[source]

Bases: ABC

Base Class for Stochastic Contributions to the PSD.

ndim = None
added_stochastic_list = []
classmethod get_Sh(f, *params, **kwargs)[source]

Calculate the power spectral density of the stochastic contribution.

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

  • *params (ndarray | list) – Parameters for the stochastic model.

  • **kwargs (Any) – Keyword arguments for the stochastic model.

Return type:

float | ndarray

static specific_Sh_function(f, *args, **kwargs)[source]

Calculate the power spectral density contained in a stochastic signal contribution.

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

  • *args (Any) – Any arguments for the function.

  • **kwargs (Any) – Any keyword arguments for the function.

Return type:

float | ndarray

Returns:

Power spectral density contained in stochastic signal.

Combinatorial Stochastic Container

class lisatools.stochastic.StochasticContributionContainer(stochastic_contribution_dict)[source]

Bases: object

Container for multiple Stochastic Contributions

Parameters:

stochastic_contribution_dict (dict[StochasticContribution]) – Dictionary with multiple Stochastic entries. Keys are the names and values are of type StochasticContribution.

property stochastic_contribution_dict: dict[StochasticContribution]

Stochastic contribution storage.

get_Sh(f, params_dict, kwargs_dict)[source]

Calculate Sh for stochastic contribution.

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

  • params_dict (dict[tuple]) – Dictionary with keys equivalent to self.stochastic_contribution_dict.keys(). Values are the parameters for each associated model.

  • kwargs_dict (dict[dict]) – Dictionary with keys equivalent to self.stochastic_contribution_dict.keys(). Values are the keyword argument dicts for each associated model.

Return type:

ndarray

Returns:

Stochastic contribution.

Stock Stochastic Models

class lisatools.stochastic.HyperbolicTangentGalacticForeground[source]

Bases: StochasticContribution

Hyperbolic Tangent-based foreground fitting function.

ndim = 5
static specific_Sh_function(f, amp, fk, alpha, s1, s2)[source]

Hyperbolic tangent model 1 for the Galaxy foreground noise

This model for the PSD contribution from the Galactic foreground noise is given by

\[S_\text{gal} = \frac{A_\text{gal}}{2}e^{-s_1f^\alpha}f^{-7/3}\left[ 1 + \tanh{\left(-s_2 (f - f_k)\right)} \right],\]

where \(A_\text{gal}\) is the amplitude of the stochastic signal, \(f_k\) is the knee frequency at which a bend occurs, math:alpha is a power law parameter, \(s_1\) is a slope parameter below the knee, and \(s_2\) is a slope parameter after the knee.:

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

  • amp (float) – Amplitude parameter for the Galaxy.

  • fk (float) – Knee frequency in Hz.

  • alpha (float) – Power law parameter.

  • s1 (float) – Slope parameter below knee.

  • s2 (float) – Slope parameter above knee.

Return type:

float | ndarray

Returns:

PSD of the Galaxy foreground noise

class lisatools.stochastic.FittedHyperbolicTangentGalacticForeground[source]

Bases: HyperbolicTangentGalacticForeground

ndim = 1
amp = 3.26651613e-44
alpha = 1.18300266
day = 86400.0
month = 2635200.0
year = 31557600.0
Xobs = [86400.0, 7905600.0, 15811200.0, 31557600.0, 63115200.0, 126230400.0, 315576000.0]
knee = [0.0115120924, 0.00401884128, 0.00347302482, 0.00277606177, 0.00241178384, 0.00209278117, 0.00157362626]
Slope1 = [941.315118, 1368.87568, 1687.29474, 1763.27234, 2326.78814, 3014.30978, 3749.70124]
Slope2 = [103.239773, 1033.51646, 1622.04855, 1686.31844, 2068.21665, 2957.74596, 3151.99454]
Tmax = 315581497.635456
classmethod specific_Sh_function(f, Tobs)[source]

Fitted hyperbolic tangent model 1 for the Galaxy foreground noise.

This class fits the parameters for HyperbolicTangentGalacticForeground using analytic estimates from (# TODO). The fit is a function of time, so the user inputs Tobs.

# Sgal_1d = 2.2e-44*np.exp(-(fr**1.2)*0.9e3)*(fr**(-7./3.))*0.5*(1.0 + np.tanh(-(fr-1.4e-2)*0.7e2)) # Sgal_3m = 2.2e-44*np.exp(-(fr**1.2)*1.7e3)*(fr**(-7./3.))*0.5*(1.0 + np.tanh(-(fr-4.8e-3)*5.4e2)) # Sgal_1y = 2.2e-44*np.exp(-(fr**1.2)*2.2e3)*(fr**(-7./3.))*0.5*(1.0 + np.tanh(-(fr-3.1e-3)*1.3e3)) # Sgal_2y = 2.2e-44*np.exp(-(fr**1.2)*2.2e3)*(fr**(-7./3.))*0.5*(1.0 + np.tanh(-(fr-2.3e-3)*1.8e3)) # Sgal_4y = 2.2e-44*np.exp(-(fr**1.2)*2.9e3)*(fr**(-7./3.))*0.5*(1.0 + np.tanh(-(fr-2.0e-3)*1.9e3))

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

  • Tobs (float) – Observation time in seconds.

Return type:

float | ndarray

Returns:

PSD of the Galaxy foreground noise