scri.sample_waveforms

Functions

constant_waveform(**kwargs)

WaveformModes object with constant values in each mode

create_fake_finite_radius_strain_h5file([...])

Create an HDF5 file with fake finite-radius GW strain data in the NRAR format, as used by the Spectral Einstein Code (SpEC).

fake_precessing_waveform([t_0, t_1, dt, ...])

Construct a strain waveform with realistic precession effects.

modes_constructor(constructor_statement, ...)

WaveformModes object filled with data from the input functor

pn_leading_order_amplitude(ell, m, x[, ...])

Return the leading-order amplitude of r*h/M in PN theory

random_waveform(**kwargs)

WaveformModes object filled with random data at each time step

random_waveform_proportional_to_time(**kwargs)

WaveformModes object filled with random data times the time coordinate

single_mode(ell, m, **kwargs)

WaveformModes object with 1 in selected slot and 0 elsewhere

single_mode_constant_rotation(**kwargs)

Return WaveformModes object a single nonzero mode, with phase proportional to time

single_mode_proportional_to_time(**kwargs)

Return WaveformModes object a single nonzero mode, proportional to time

single_mode_proportional_to_time_supertranslated(...)

Return WaveformModes as in single_mode_proportional_to_time, with analytical supertranslation

scri.sample_waveforms.constant_waveform(**kwargs)[source]

WaveformModes object with constant values in each mode

Additional keyword arguments are passed to modes_constructor.

scri.sample_waveforms.create_fake_finite_radius_strain_h5file(output_file_path='./rh_FiniteRadii_CodeUnits.h5', n_subleading=3, amp=1.0, t_0=0.0, t_1=3000.0, dt=0.1, r_min=100.0, r_max=600.0, n_radii=24, ell_max=8, initial_adm_energy=0.99, avg_lapse=0.99, avg_areal_radius_diff=1.0, mass_ratio=1.0, precession_opening_angle=0.0, **kwargs)[source]

Create an HDF5 file with fake finite-radius GW strain data in the NRAR format, as used by the Spectral Einstein Code (SpEC). The asymptotic waveform is created by the function scri.sample_waveforms.fake_precessing_waveform and then radius-dependent terms are added to it. These subleading artificial “near-zone” effects are simple sinusoids. The finite-radius waveform, scaled by a factor of the radius, is then,

r*h(r) = h_0 + h_1*r**-1 + h_2*r**-2 + … + h_n*r**-n

where h_0 is the waveform from scri.sample_waveforms.fake_precessing_waveform() and n is chosen by the user.

Finally, the finite-radius waveforms as output by SpEC uses simulation coordinates for radius and time, which do not perfectly parametrize outgoing null rays. This function approximates these simulation coordinates so that the data in the resulting HDF5 file most nearly mimics that of a SpEC HDF5 output file.

Parameters:
output_file_path: str

The name and path of the output file. The filename must be “rh_FiniteRadius_CodeUnits.h5” if you wish to be able to run scri.extrapolation.extrapolate on it.

n_subleading: int [defaults to 3]

The number of subleading, radius-dependent terms to add to the asymptotic waveform.

amp: float [defaults to 1.0]

The amplitude of the subleading, radius-dependent terms.

t_0: float [defaults to 0.0]
t_1: float [defaults to 3000.0]

The initial and final times in the output waveform. Note that the merger is placed 100.0 time units before t_1, and several transitions are made before this, so t_0 must be that far ahead of t_1.

dt: float [defaults to 0.1]

Spacing of output time series.

r_min: float [defaults to 100.0]
r_max: float [defaults to 600.0]
n_radii: float [defaults to 24]

The minimum and maximum radius, and the number of radii between these values, at which to produce a finite-radius waveform. These will be equally spaced in inverse radius.

ell_max: int [defaults to 8]

Largest ell value in the output modes.

initial_adm_energy: float [defaults to 0.99]

The intial ADM energy as would be computed by the SpEC intitial data solver.

avg_lapse: float [defaults to 0.99]

The value of the lapse averaged over a sphere at

avg_areal_radius_diff: float [defaults to 1.0]

How much on average the areal radius is larger than the coord radius, may be negative.

mass_ratio: float [defaults to 1.0]

Ratio of BH masses to use as input to rough approximations for orbital evolution and mode amplitudes.

precession_opening_angle: float [defaults to 0.0]

Opening angle of the precession cone. The default results in no precession. If this value is non-zero, then the following options from fake_precessing_waveform may be supplied as kwagrs:

  • precession_opening_angle_dot

  • precession_relative_rate

  • precession_nutation_angle

See the help text of fake_precessing_waveform for documentation.

scri.sample_waveforms.fake_precessing_waveform(t_0=-20.0, t_1=20000.0, dt=0.1, ell_max=8, mass_ratio=2.0, precession_opening_angle=0.5235987755982988, precession_opening_angle_dot=None, precession_relative_rate=0.1, precession_nutation_angle=None, inertial=True)[source]

Construct a strain waveform with realistic precession effects.

This model is intended to be weird enough that it breaks any overly simplistic assumptions about waveform symmetries while still being (mostly) realistic.

This waveform uses only the very lowest-order terms from PN theory to evolve the orbital frequency up to a typical constant value (with a smooth transition), and to construct modes that have very roughly the correct amplitudes as a function of the orbital frequency. Modes with equal ell values but opposite m values are modulated antisymmetrically, though this modulation decays quickly after merger – roughly as it would behave in a precessing system. The modes are then smoothly transitioned to an exponential decay after merger. The frame is a simulated precession involving the basic orbital rotation precessing about a cone of increasing opening angle and nutating about that cone on the orbital time scale, but settling down to a constant direction shortly after merger. (Though there is little precise physical content, these features are all found in real waveforms.) If the input argument inertial is True (the default), the waveform is transformed back to the inertial frame before returning.

Parameters:
t_0: float [defaults to -20.0]
t_1: float [defaults to 20_000.0]

The initial and final times in the output waveform. Note that the merger is placed 100.0 time units before t_1, and several transitions are made before this, so t_0 must be that far ahead of t_1.

dt: float [defaults to 0.1]

Spacing of output time series.

ell_max: int [defaults to 8]

Largest ell value in the output modes.

mass_ratio: float [defaults to 2.0]

Ratio of BH masses to use as input to rough approximations for orbital evolution and mode amplitudes.

precession_opening_angle: float [defaults to pi/6]

Opening angle of the precession cone.

precession_opening_angle_dot: float [defaults to 2*precession_opening_angle/(t_merger-t_0)]

Rate at which precession cone opens.

precession_relative_rate: float [defaults to 0.1]

Fraction of the magnitude of the orbital angular velocity at which it precesses.

precession_nutation_angle: float [defaults to precession_opening_angle/10]

Angle (relative to precession_opening_angle) by which the orbital angular velocity nutates.

scri.sample_waveforms.modes_constructor(constructor_statement, data_functor, **kwargs)[source]

WaveformModes object filled with data from the input functor

Additional keyword arguments are mostly passed to the WaveformModes initializer, though some more reasonable defaults are provided.

Parameters:
constructor_statementstr

This is a string form of the function call used to create the object. This is passed to the WaveformBase initializer as the parameter of the same name. See the docstring for more information.

data_functorfunction

Takes a 1-d array of time values and an array of (ell, m) values and returns the complex array of data.

tfloat array, optional

Time values of the data. Default is np.linspace(-10., 100., num=1101)).

ell_min, ell_maxint, optional

Smallest and largest ell value present in the data. Defaults are 2 and 8.

scri.sample_waveforms.pn_leading_order_amplitude(ell, m, x, mass_ratio=1.0)[source]

Return the leading-order amplitude of r*h/M in PN theory

These expressions are from Eqs. (330) of Blanchet’s Living Review (2014).

Note that x is just the orbital angular velocity to the (2/3) power.

scri.sample_waveforms.random_waveform(**kwargs)[source]

WaveformModes object filled with random data at each time step

Additional keyword arguments are passed to modes_constructor.

Parameters:
uniform_timebool, optional

Use uniform, rather than random, time steps. Default is False.

begin, endfloat, optional

Initial and final times of the time data. Default values are -10., 100.

n_timesint, optional

Number of time steps in the time data. Default is 1101

rotatingbool, optional

If True, use a Corotating frame, with random orientation at each instant. Default is True.

scri.sample_waveforms.random_waveform_proportional_to_time(**kwargs)[source]

WaveformModes object filled with random data times the time coordinate

Additional keyword arguments are passed to modes_constructor.

Parameters:
uniform_timebool, optional

Use uniform, rather than random, time steps. Default is False.

begin, endfloat, optional

Initial and final times of the time data. Default values are -10., 100.

n_timesint, optional

Number of time steps in the time data. Default is 1101

rotatingbool, optional

If True, use a Corotating frame, with random orientation at each instant. Default is True.

scri.sample_waveforms.single_mode(ell, m, **kwargs)[source]

WaveformModes object with 1 in selected slot and 0 elsewhere

Additional keyword arguments are passed to modes_constructor.

Parameters:
ell, mint

The (ell, m) value of the nonzero mode

scri.sample_waveforms.single_mode_constant_rotation(**kwargs)[source]

Return WaveformModes object a single nonzero mode, with phase proportional to time

The waveform output by this function will have just one nonzero mode. The behavior of that mode will be fairly simple; it will be given by exp(i*omega*t). Note that omega can be complex, which gives damping.

Parameters:
sint, optional

Spin weight of the waveform field. Default is -2.

ell, mint, optional

The (ell, m) values of the nonzero mode in the returned waveform. Default value is (abs(s), -abs(s)).

ell_min, ell_maxint, optional

Smallest and largest ell values present in the output. Default values are abs(s) and 8.

data_typeint, optional

Default value is whichever psi_n corresponds to the input spin. It is important to choose these, rather than h or sigma for the analytical solution to translations, which doesn’t account for the direct contribution of supertranslations (as opposed to the indirect contribution, which involves moving points around).

t_0, t_1float, optional

Beginning and end of time. Default values are -20. and 20.

dtfloat, optional

Time step. Default value is 0.1.

omegacomplex, optional

Constant of proportionality such that nonzero mode is exp(i*omega*t). Note that this can be complex, which implies damping. Default is 0.5.

scri.sample_waveforms.single_mode_proportional_to_time(**kwargs)[source]

Return WaveformModes object a single nonzero mode, proportional to time

The waveform output by this function will have just one nonzero mode. The behavior of that mode will be particularly simple; it will just be proportional to time.

Parameters:
sint, optional

Spin weight of the waveform field. Default is -2.

ell, mint, optional

The (ell, m) values of the nonzero mode in the returned waveform. Default value is (abs(s), -abs(s)).

ell_min, ell_maxint, optional

Smallest and largest ell values present in the output. Default values are abs(s) and 8.

data_typeint, optional

Default value is whichever psi_n corresponds to the input spin. It is important to choose these, rather than h or sigma for the analytical solution to translations, which doesn’t account for the direct contribution of supertranslations (as opposed to the indirect contribution, which involves moving points around).

t_0, t_1float, optional

Beginning and end of time. Default values are -20. and 20.

dtfloat, optional

Time step. Default value is 0.1.

betacomplex, optional

Constant of proportionality such that nonzero mode is beta*t. Default is 1.

scri.sample_waveforms.single_mode_proportional_to_time_supertranslated(**kwargs)[source]

Return WaveformModes as in single_mode_proportional_to_time, with analytical supertranslation

This function constructs the same basic object as the single_mode_proportional_to_time, but then applies an analytical supertranslation. The arguments to this function are the same as to the other, with two additions: