Confusing behaviour of injection
I just want to highlight some potentially odd behaviour when injecting code that may be confusing. Here is a script to produce an IFO
object with a simulated signal in noise
import peyote
import matplotlib.pyplot as plt
import numpy as np
time_duration = 1.
sampling_frequency = 4096.
simulation_parameters = dict(
mass_1=36.,
mass_2=29.,
spin_1=[0, 0, 0],
spin_2=[0, 0, 0],
luminosity_distance=410.,
inclination_angle=0.,
waveform_phase=0.,
waveform_approximant='IMRPhenomPv2',
reference_frequency=50.,
ra=0,
dec=1,
geocent_time=0,
psi=1
)
source = peyote.source.BinaryBlackHole(
'BBH', sampling_frequency, time_duration)
hf_signal = source.frequency_domain_strain(simulation_parameters)
IFO = peyote.detector.H1
hf_noise, frequencies = IFO.power_spectral_density.get_noise_realisation(
sampling_frequency, time_duration)
plt.loglog(frequencies, hf_noise)
IFO.set_data(frequency_domain_strain=hf_noise)
IFO.inject_signal(source, simulation_parameters)
IFO.set_spectral_densities(frequencies)
IFO.whiten_data()
plt.loglog(frequencies, hf_noise)
plt.show()
I see three confusing points
-
hf_noise
is returned fromIFO.power_spectral_density.get_noise_realisation
and then immediately set. Can we have a wrapper which does this all in one? -
It is opaque to a user what
set_spectral densitiesand
whiten_dataare going (I'm not sure I understand at least). If these are always required, can they be done in the
init` or some other automatic way? -
You'll notice I've plotted
hf_noise
twice - see the twoplt.loglog
calls. These produce the ba ckground noise by itself, then the background noise + signal. This is quite perplexing from a users point of view. Can it be made more explicit?
Note: for 3, I think (but I'm unsure) that this is one of those cases where you don't have the data, but a pointer.
Tagging @paul-lasky @colm.talbot @nikhil.sarin as people who may know more about the detectors
internals.