Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALPulsar 7.1.1.1-3a66518
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
simulateCW.py
Go to the documentation of this file.
1# Copyright (C) 2017 Karl Wette
2#
3# This program is free software; you can redistribute it and/or modify it
4# under the terms of the GNU General Public License as published by the
5# Free Software Foundation; either version 2 of the License, or (at your
6# option) any later version.
7#
8# This program is distributed in the hope that it will be useful, but
9# WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11# Public License for more details.
12#
13# You should have received a copy of the GNU General Public License along
14# with this program; if not, write to the Free Software Foundation, Inc.,
15# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16
17## \defgroup lalpulsar_py_simulateCW SimulateCW
18## \ingroup lalpulsar_python
19r"""
20Generate strain time series of a continuous-wave signal in the detector frame,
21given a function which computes signal phase and amplitudes as functions of time.
22
23The given function should compute quantities \f$\Delta\phi(t)\f$, \f$a_+(t)\f$,
24and \f$a_\times(t)\f$ such that the plus and cross gravitational-wave
25polarisations \f$h_+(t)\f$ and \f$h_\times(t)\f$ are given by:
26\f{eqnarray}{
27h_+(t) & = & a_+(t) \cos[\phi_0 + \Delta\phi(t)] \; , \\
28h_\times(t) & = & a_\times(t)\sin[\phi_0 + \Delta\phi(t)] \; .
29\f}
30
31This module provides a class CWSimulator() to generate the strain time series.
32CWSimulator() can also directly write frame files and SFT files. Example usage:
33
34~~~
35import lal
36from lalpulsar import simulateCW
37
38def waveform(h0, cosi, freq, f1dot):
39 def wf(dt):
40 dphi = lal.TWOPI * (freq * dt + f1dot * 0.5 * dt**2)
41 ap = h0 * (1.0 + cosi**2) / 2.0
42 ax = h0 * cosi
43 return dphi, ap, ax
44 return wf
45
46tref = 900043200
47tstart = 900000000
48Tdata = 86400
49h0 = 1e-24
50cosi = 0.123
51psi = 2.345
52phi0 = 3.210
53freq = 10.0
54f1dot = -1.35e-8
55dt_wf = 5
56alpha = 6.12
57delta = 1.02
58detector = 'H1'
59
60wf = waveform(h0, cosi, freq, f1dot)
61S = simulateCW.CWSimulator(tref, tstart, Tdata, wf, dt_wf, phi0, psi, alpha, delta, detector)
62
63# To write SFT files
64for file, i, N in S.write_sft_files(fmax=32, Tsft=1800, comment="simCW"):
65 print('Generated SFT file %s (%i of %i)' % (file, i+1, N))
66
67# To write frame files
68for file, i, N in S.write_frame_files(fs=1, Tframe=1800, comment="simCW"):
69 print('Generated frame file %s (%i of %i)' % (file, i+1, N))
70
71~~~
72"""
73## @{
74
75from __future__ import division, print_function
76
77import os
78import sys
79import re
80import math
81
82import lal
83import lalpulsar
84
85from . import git_version
86
87__author__ = "Karl Wette <karl.wette@ligo.org>"
88__version__ = git_version.id
89__date__ = git_version.date
90
91
92class CWSimulator(object):
93 def __init__(
94 self,
95 tref,
96 tstart,
97 Tdata,
98 waveform,
99 dt_wf,
100 phi0,
101 psi,
102 alpha,
103 delta,
104 det_name,
105 earth_ephem_file="earth00-40-DE405.dat.gz",
106 sun_ephem_file="sun00-40-DE405.dat.gz",
107 tref_at_det=False,
108 extra_comment=None,
109 ):
110 """
111 Initialise a continuous-wave signal simulator.
112
113 @param tref: reference time of signal phase at Solar System barycentre, in GPS seconds
114 (but see @b tref_at_det)
115 @param tstart: start time of signal, in GPS seconds
116 @param Tdata: total duration of signal, in seconds
117 @param waveform: function which computes signal phase and amplitudes as functions of time:
118 @b dphi, @b aplus, @b across = @b waveform(dt), where:
119 @b dt = time since reference time @b tref;
120 @b dphi = phase of signal at time @b dt relative to reference time @b tref, in radians;
121 @b aplus = strain amplitude of plus polarisation at time @b dt;
122 @b across = strain amplitude of cross polarisation at time @b dt
123 @param dt_wf: sampling time of the function @c waveform; this need only be small enough to ensure
124 that @c dphi, @c aplus, and @c across are smoothly interpolated, and does not need to make
125 the desired sampling frequency of the output strain time series
126 @param phi0: initial phase of the gravitational-wave signal at @b tstart, in radians
127 @param psi: polarisation angle of the gravitational-wave source, in radians
128 @param alpha: right ascension of the gravitational-wave source, in radians
129 @param delta: declination of the gravitational-wave source, in radians
130 @param det_name: name of the gravitational-wave detector to simulate a response for;
131 e.g. @c "H1" for LIGO Hanford, @c "L1" for LIGO Livingston, @c "V1" for Virgo
132 @param earth_ephem_file: name of file to load Earth ephemeris from
133 @param sun_ephem_file: name of file to load Sun ephemeris from
134 @param tref_at_det: default False; if True, shift reference time @b tref so that @b dt = 0 is
135 @b tref in @e detector frame instead of Solar System barycentre frame, useful if e.g. one
136 wants to turn on signal only for @b dt > 0, one can use @b tref as the turn-on time
137 @param extra_comment: additional text to add to comment string in frame/SFT headers
138 (not filenames), e.g. for wrapper script commandlines
139 """
140
141 self.__origin_str = "Generated by %s, %s-%s (%s)" % (
142 __file__,
143 git_version.id,
144 git_version.status,
145 git_version.date,
146 )
147 if extra_comment:
148 self.__origin_str += ", " + extra_comment
149
150 # store arguments
151 self.__tstart = tstart
152 self.__Tdata = Tdata
153
154 # parse detector name
155 try:
156 _, self.__site_index = lalpulsar.FindCWDetector(det_name, True)
157 assert self.__site_index >= 0
158 except:
159 raise ValueError("Invalid detector name det_name='%s'" % det_name)
160 self.__site = lal.CachedDetectors[self.__site_index]
161
162 # load Earth and Sun ephemerides
163 self.__ephemerides = lalpulsar.InitBarycenter(earth_ephem_file, sun_ephem_file)
164
165 if tref_at_det:
166 # calculate barycentric delay at reference time
167 bary_state = lalpulsar.EarthState()
168 bary_input = lalpulsar.BarycenterInput()
169 bary_emit = lalpulsar.EmissionTime()
170 bary_input.tgps = tref
171 bary_input.site = self.__site
172 for i in range(0, 3):
173 bary_input.site.location[i] /= lal.C_SI
174 bary_input.alpha = alpha
175 bary_input.delta = delta
176 bary_input.dInv = 0.0
177 lalpulsar.BarycenterEarth(bary_state, bary_input.tgps, self.__ephemerides)
178 lalpulsar.Barycenter(bary_emit, bary_input, bary_state)
179
180 # adjust reference time so that dt = 0 is tref in detector frame
181 tref += bary_emit.deltaT
182
183 # start signal time series 'Tpad_wf' before/after output strain time series
184 # add sufficient padding to signal for maximum Doppler modulation time shifts, otherwise
185 # lalpulsar.PulsarSimulateCoherentGW() will output zeros without complaint (unless
186 # you run with LAL_DEBUG_LEVEL=warning)
187 Tpad_wf = 2.0 * lal.AU_SI / lal.C_SI
188 tstart_wf = tstart - Tpad_wf
189 Nwf = int(math.ceil(float(Tdata + 2 * Tpad_wf) / float(dt_wf)))
190
191 # create REAL8TimeSeries to store signal phase
192 self.__phi = lal.CreateREAL8TimeSeries(
193 "phi", tstart_wf, 0, dt_wf, lal.DimensionlessUnit, Nwf
194 )
195
196 # create REAL4TimeVectorSeries to store signal amplitudes
197 # - LAL provides no creator function for this type, so must be done manually
198 self.__a = lal.REAL4TimeVectorSeries()
199 self.__a.name = "a+,ax"
200 self.__a.epoch = tstart_wf
201 self.__a.deltaT = dt_wf
202 self.__a.f0 = 0
203 self.__a.sampleUnits = lal.StrainUnit
204 self.__a.data = lal.CreateREAL4VectorSequence(Nwf, 2)
205
206 # call waveform() to fill time series of signal phase and amplitudes
207 dt = float(tstart_wf - tref)
208 for i in range(0, Nwf):
209 dphi, aplus, across = waveform(dt)
210 self.__phi.data.data[i] = phi0 + dphi
211 self.__a.data.data[i][0] = aplus
212 self.__a.data.data[i][1] = across
213 dt += dt_wf
214
215 # create and initialise PulsarCoherentGW struct
216 self.__wf = lalpulsar.PulsarCoherentGW()
217 self.__wf.position.system = lal.COORDINATESYSTEM_EQUATORIAL
218 self.__wf.position.longitude = alpha
219 self.__wf.position.latitude = delta
220 self.__wf.psi = psi
221 self.__wf.phi = self.__phi
222 self.__wf.a = self.__a
223
224 # create and initialise PulsarDetectorResponse struct
225 self.__detector = lalpulsar.PulsarDetectorResponse()
226 self.__detector.site = self.__site
227 self.__detector.ephemerides = self.__ephemerides
228
229 def _simulate_coherent_gw(self, h, noise_sqrt_Sh, noise_seed):
230 # generate strain time series
231 lalpulsar.PulsarSimulateCoherentGW(h, self.__wf, self.__detector)
232
233 # add Gaussian noise, if requested
234 if noise_sqrt_Sh > 0:
235 assert noise_seed is not None
236 assert noise_seed > 0
237 noise_sigma = math.sqrt(0.5 / h.deltaT) * noise_sqrt_Sh
238 lalpulsar.AddGaussianNoise(h, noise_sigma, noise_seed)
239
240 def get_strain(self, fs, tmin=0, tmax=None, noise_sqrt_Sh=0, noise_seed=None):
241 """
242 Generate strain time series of a continuous-wave signal in the detector frame.
243
244 @param fs: sampling frequency of strain time series, in Hz
245 @param tmin: start time for strain time series, as offsets from self.__tstart
246 @param tmax: start time for strain time series, as offsets from self.__tstart
247 @param noise_sqrt_Sh: if >0, add Gaussian noise with square-root single-sided power
248 spectral density given by this value, in Hz^(-1/2)
249 @param noise_seed: use this seed for the random number generator used to create noise;
250 required if noise_sqrt_Sh >0
251
252 @return (@b t, @b h), where:
253 @b t = start of time strain time series, in GPS seconds;
254 @b h = strain time series
255 """
256
257 # process tmin/tmax range (interpreted relative to self.__tstart)
258 if (tmin < 0) or (tmin >= self.__Tdata):
259 raise ValueError("tmin must be within [0,{}).".format(self.__Tdata))
260 if tmax is None:
261 tmax = self.__Tdata
262 elif (tmax <= 0) or (tmax > self.__Tdata):
263 raise ValueError("tmax must be within (0,{}].".format(self.__Tdata))
264 tspan = tmax - tmin
265
266 # create REAL4TimeSeries to store output time series
267 Nh = int(fs * tspan)
268 h = lal.CreateREAL4TimeSeries(
269 "h", self.__tstart + tmin, 0, 1.0 / fs, lal.DimensionlessUnit, Nh
270 )
271
272 # generate strain time series
273 self._simulate_coherent_gw(h, noise_sqrt_Sh, noise_seed)
274 return (h.epoch, h.data.data)
275
277 self, fs, Tblock, noise_sqrt_Sh=0, noise_seed=None, prog_bar=None
278 ):
279 """
280 Generate strain time series of a continuous-wave signal in the detector frame, in contiguous blocks.
281
282 @param fs: sampling frequency of strain time series, in Hz
283 @param Tblock: length of each block, in seconds; should divide evenly into @b Tdata
284 @param noise_sqrt_Sh: if >0, add Gaussian noise with square-root single-sided power
285 spectral density given by this value, in Hz^(-1/2)
286 @param noise_seed: use this seed for the random number generator used to create noise;
287 if None, generate a random seed using os.urandom()
288 @param prog_bar: use to display a progress bar, e.g. prog_bar=tqdm
289
290 @return (@b t, @b h, @b i, @b N), where:
291 @b t = start of time strain time series, in GPS seconds;
292 @b h = strain time series;
293 @b i = block index, starting from zero;
294 @b N = number of blocks
295
296 This is a Python generator function and so should be called as follows:
297 ~~~
298 S = CWSimulator(...)
299 for t, h, i, N in S.get_strain_blocks(...):
300 ...
301 ~~~
302 """
303
304 # work out number of blocks
305 Nblock = int(round(self.__Tdata / Tblock))
306 if Tblock * Nblock > self.__Tdata:
307 raise ValueError(
308 "Length of block Tblock=%g does not divide evenly into Tdata=%g"
309 % (Tblock, self.__Tdata)
310 )
311
312 # if no noise seed is given, generate a (non-zero) random seed using os.urandom()
313 if not noise_seed:
314 noise_seed = 0
315 while not (0 < noise_seed and noise_seed < lal.LAL_INT4_MAX - Nblock):
316 noise_seed = int.from_bytes(os.urandom(4), sys.byteorder, signed=False)
317
318 # iterate over blocks
319 blocks = range(0, Nblock)
320 if prog_bar is not None:
321
322 # wrap iterator in progress bar
323 blocks = prog_bar(blocks)
324
325 # generate strain time series in blocks of length 'Tblock'
326 tmin = 0
327 for iblock in blocks:
328 epoch, hoft = self.get_strain(
329 fs,
330 tmin=tmin,
331 tmax=tmin + Tblock,
332 noise_sqrt_Sh=noise_sqrt_Sh,
333 noise_seed=noise_seed + iblock,
334 )
335 yield epoch, hoft, iblock, Nblock
336 tmin += Tblock
337
339 self,
340 fs,
341 Tframe,
342 comment="simCW",
343 out_dir=".",
344 noise_sqrt_Sh=0,
345 noise_seed=None,
346 prog_bar=None,
347 ):
348 """
349 Write frame files [1] containing strain time series of a continuous-wave signal.
350
351 The strain time series is written as double-precision post-processed data (ProcData) channel named
352 <tt>&lt;detector&gt;:SIMCW-STRAIN</tt>,
353 where <tt>&lt;detector&gt;</tt> is the 2-character detector prefix (e.g. <tt>H1</tt> for LIGO Hanford,
354 <tt>L1</tt> for LIGO Livingston, <tt>V1</tt> for Virgo).
355
356 @param fs: sampling frequency of strain time series, in Hz
357 @param Tframe: length of each frame, in seconds; should divide evenly into @b Tdata
358 @param comment: frame file name comment, may only contain A-Z, a-z, 0-9, _, +, # characters
359 @param out_dir: output directory to write frame files into
360 @param noise_sqrt_Sh: if >0, add Gaussian noise with square-root single-sided power
361 spectral density given by this value, in Hz^(-1/2)
362 @param noise_seed: use this seed for the random number generator used to create noise;
363 if None, generate a random seed using os.urandom()
364 @param prog_bar: use to display a progress bar, e.g. prog_bar=tqdm
365
366 @return (@b file, @b i, @b N), where:
367 @b file = name of frame file just written;
368 @b i = frame file index, starting from zero;
369 @b N = number of frame files
371 This is a Python generator function and so should be called as follows:
372 ~~~
373 S = CWSimulator(...)
374 for file, i, N in S.write_frame_files(...):
375 ...
376 ~~~
377
378 [1] https://dcc.ligo.org/LIGO-T970130/public
379 """
380
381 try:
382 import lalframe
383 except ImportError:
384 raise ImportError("SWIG wrappings of LALFrame cannot be imported")
385
386 # check for valid frame filename comment (see LIGO-T010150)
387 valid_comment = re.compile(r"^[A-Za-z0-9_+#]+$")
388 if not valid_comment.match(comment):
389 raise ValueError(
390 "Frame file comment='%s' may only contain A-Z, a-z, 0-9, _, +, # characters"
391 % comment
392 )
393
394 # generate strain time series in blocks of length 'Tframe'
395 frame_h = None
396 for t, h, i, N in self.get_strain_blocks(
397 fs,
398 Tframe,
399 noise_sqrt_Sh=noise_sqrt_Sh,
400 noise_seed=noise_seed,
401 prog_bar=prog_bar,
402 ):
403 # create and initialise REAL8TimeSeries to write to frame files
404 if frame_h is None:
405 frame_h_channel = "%s:SIMCW-STRAIN" % self.__site.frDetector.prefix
406 frame_h = lal.CreateREAL8TimeSeries(
407 frame_h_channel, t, 0, 1.0 / fs, lal.DimensionlessUnit, len(h)
408 )
409 frame_h.epoch = t
410 frame_h.data.data = h
411
412 # create standard frame file name (see LIGO-T010150)
413 frame_src = self.__site.frDetector.prefix[0]
414 frame_desc = comment
415 frame_t0 = int(t.gpsSeconds)
416 frame_Tdata = int(math.ceil(float(t + Tframe)) - math.floor(float(t)))
417 frame_name = "%s-%s-%u-%u.gwf" % (
418 frame_src,
419 frame_desc,
420 frame_t0,
421 frame_Tdata,
422 )
423 frame_path = os.path.join(out_dir, frame_name)
424
425 # create frame
426 frame_det_bits = 2 * self.__site_index
427 frame = lalframe.FrameNew(
428 t, Tframe, self.__class__.__name__, -1, i, frame_det_bits
429 )
430
431 # add strain time series to frame
432 lalframe.FrameAddREAL8TimeSeriesProcData(frame, frame_h)
433
434 # add history
435 lalframe.FrameAddFrHistory(frame, "origin", self.__origin_str)
436
437 # write frame
438 lalframe.FrameWrite(frame, frame_path)
439
440 # yield current file name for e.g. printing progress
441 yield frame_path, i, N
442
443 def get_sfts(
444 self,
445 fmax,
446 Tsft,
447 noise_sqrt_Sh=0,
448 noise_seed=None,
449 window="rectangular",
450 window_param=0,
451 prog_bar=None,
452 fmin=0,
453 ):
454 """
455 Generate SFTs [2] containing strain time series of a continuous-wave signal.
456
457 @param fmax: maximum SFT frequency, in Hz
458 @param Tsft: length of each SFT, in seconds; should divide evenly into @b Tdata
459 @param noise_sqrt_Sh: if >0, add Gaussian noise with square-root single-sided power
460 spectral density given by this value, in Hz^(-1/2)
461 @param noise_seed: use this seed for the random number generator used to create noise;
462 if None, generate a random seed using os.urandom()
463 @param window: if not None, window the time series before performing the FFT, using
464 the named window function; see XLALCreateNamedREAL8Window()
465 @param window_param: parameter for the window function given by @b window, if needed
466 @param prog_bar: use to display a progress bar, e.g. prog_bar=tqdm
467 @param fmin: if >0, minimum SFT frequency, in Hz
468 (note that this only modifies the output SFT bandwidth; internally a full-band SFT is still produced by sampling at 2*fmax)
469
470 @return (@b sft, @b i, @b N), where:
471 @b sft = SFT;
472 @b i = SFT file index, starting from zero;
473 @b N = number of SFTs
474
475 This is a Python generator function and so should be called as follows:
476 ~~~
477 S = CWSimulator(...)
478 for sft, i, N in S.get_sfts(...):
479 ...
480 ~~~
481
482 [2] https://dcc.ligo.org/LIGO-T040164/public
483 """
484
485 # create timestamps for generating one SFT per time series
486 sft_ts = lalpulsar.CreateTimestampVector(1)
487 sft_ts.deltaT = Tsft
488
489 # generate strain time series in blocks of length 'Tsft'
490 sft_h = None
491 sft_fs = 2 * fmax
492 for t, h, i, N in self.get_strain_blocks(
493 sft_fs,
494 Tsft,
495 noise_sqrt_Sh=noise_sqrt_Sh,
496 noise_seed=noise_seed,
497 prog_bar=prog_bar,
498 ):
499 # create and initialise REAL8TimeSeries to write to SFT files
500 if sft_h is None:
501 sft_name = self.__site.frDetector.prefix
502 sft_h = lal.CreateREAL8TimeSeries(
503 sft_name, t, 0, 1.0 / sft_fs, lal.DimensionlessUnit, len(h)
504 )
505 sft_h.epoch = t
506 sft_h.data.data = h
507
508 # create SFT, possibly with windowing
509 sft_ts.data[0] = t
510 sft_vect = lalpulsar.MakeSFTsFromREAL8TimeSeries(
511 sft_h, sft_ts, window, window_param
512 )
513
514 if fmin != 0:
515 sft_vect = lalpulsar.ExtractStrictBandFromSFTVector(
516 sft_vect, fMin=fmin, Band=fmax - fmin
517 )
518
519 # yield current SFT
520 yield sft_vect.data[0], i, N
521
522 def write_sft_files(
523 self,
524 fmax,
525 Tsft,
526 comment="simCW",
527 out_dir=".",
528 noise_sqrt_Sh=0,
529 noise_seed=None,
530 window="rectangular",
531 window_param=0,
532 prog_bar=None,
533 fmin=0,
534 ):
535 """
536 Write SFT files [2] containing strain time series of a continuous-wave signal.
537
538 @param fmax: maximum SFT frequency, in Hz
539 @param Tsft: length of each SFT, in seconds; should divide evenly into @b Tdata
540 @param comment: SFT file name comment, may only contain A-Z, a-z, 0-9 characters
541 @param out_dir: output directory to write SFT files into
542 @param noise_sqrt_Sh: if >0, add Gaussian noise with square-root single-sided power
543 spectral density given by this value, in Hz^(-1/2)
544 @param noise_seed: use this seed for the random number generator used to create noise;
545 if None, generate a random seed using os.urandom()
546 @param window: if not None, window the time series before performing the FFT, using
547 the named window function; see XLALCreateNamedREAL8Window()
548 @param window_param: parameter for the window function given by @b window, if needed
549 @param prog_bar: use to display a progress bar, e.g. prog_bar=tqdm
550 @param fmin: if >0, minimum SFT frequency, in Hz
551 (note that this only modifies the output SFT bandwidth; internally a full-band SFT is still produced by sampling at 2*fmax)
552
553 @return (@b file, @b i, @b N), where:
554 @b file = name of SFT file just written;
555 @b i = SFT file index, starting from zero;
556 @b N = number of SFT files
557
558 This is a Python generator function and so should be called as follows:
559 ~~~
560 S = CWSimulator(...)
561 for file, i, N in S.write_sft_files(...):
562 ...
563 ~~~
564
565 [2] https://dcc.ligo.org/LIGO-T040164/public
566 """
567
568 # check for valid SFT filename comment (see LIGO-T040164)
569 valid_comment = re.compile(r"^[A-Za-z0-9]+$")
570 if not valid_comment.match(comment):
571 raise ValueError(
572 "SFT file comment='%s' may only contain A-Z, a-z, 0-9 characters"
573 % comment
574 )
575
576 # create SFT filename specification
577 spec = lalpulsar.SFTFilenameSpec()
578 spec.path = out_dir
579 spec.window_type = window
580 spec.window_param = window_param
581 spec.privMisc = comment
582
583 # generate SFTs
584 for sft, i, N in self.get_sfts(
585 fmax,
586 Tsft,
587 noise_sqrt_Sh=noise_sqrt_Sh,
588 noise_seed=noise_seed,
589 window=window,
590 window_param=window_param,
591 prog_bar=prog_bar,
592 fmin=fmin,
593 ):
594 # write SFT
595 lalpulsar.WriteSFT2StandardFile(sft, spec, self.__origin_str)
596
597 # yield current file name for e.g. printing progress
598 sft_path = lalpulsar.BuildSFTFilenameFromSpec(spec)
599 yield sft_path, i, N
600
601
602## @}
def write_sft_files(self, fmax, Tsft, comment="simCW", out_dir=".", noise_sqrt_Sh=0, noise_seed=None, window="rectangular", window_param=0, prog_bar=None, fmin=0)
Write SFT files [2] containing strain time series of a continuous-wave signal.
Definition: simulateCW.py:566
def get_strain(self, fs, tmin=0, tmax=None, noise_sqrt_Sh=0, noise_seed=None)
Generate strain time series of a continuous-wave signal in the detector frame.
Definition: simulateCW.py:255
def get_sfts(self, fmax, Tsft, noise_sqrt_Sh=0, noise_seed=None, window="rectangular", window_param=0, prog_bar=None, fmin=0)
Generate SFTs [2] containing strain time series of a continuous-wave signal.
Definition: simulateCW.py:483
def _simulate_coherent_gw(self, h, noise_sqrt_Sh, noise_seed)
Definition: simulateCW.py:229
def write_frame_files(self, fs, Tframe, comment="simCW", out_dir=".", noise_sqrt_Sh=0, noise_seed=None, prog_bar=None)
Write frame files [1] containing strain time series of a continuous-wave signal.
Definition: simulateCW.py:379
def __init__(self, tref, tstart, Tdata, waveform, dt_wf, phi0, psi, alpha, delta, det_name, earth_ephem_file="earth00-40-DE405.dat.gz", sun_ephem_file="sun00-40-DE405.dat.gz", tref_at_det=False, extra_comment=None)
Initialise a continuous-wave signal simulator.
Definition: simulateCW.py:139
def get_strain_blocks(self, fs, Tblock, noise_sqrt_Sh=0, noise_seed=None, prog_bar=None)
Generate strain time series of a continuous-wave signal in the detector frame, in contiguous blocks.
Definition: simulateCW.py:302
REAL8Window * XLALCreateNamedREAL8Window(const char *windowName, REAL8 beta, UINT4 length)