Support for injections in GWpy TimeSeries objects
Created by: alurban
This is a first pass at a method that allows for injections with GWpy.
The pull request includes a new method, called inject()
, which takes in a TimeSeries
object and sums it to self
along their overlapping time samples.
If self
and the new TimeSeries
have inconsistent units or sample rates, the method will raise a ValueError
. If the timeseries have non-overlapping time stamps, the method will return a copy of the original TimeSeries
.
This pull request also includes a unit test which injects a pure sinusoid into silence and then checks that the units, length, and values are all as expected.
Lastly, the method's doctstring includes an example which makes one second of Gaussian noise and downloads a simulated GW150914 waveform from LOSC, then adds them together.
This fixes #477 (closed) by @ecm0.