LALPulsar  6.1.0.1-b72065a
lalpulsar.simulateCW.CWSimulator Class Reference

Detailed Description

Definition at line 92 of file simulateCW.py.

Inherits object.

Public Member Functions

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. More...
 
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. More...
 
def get_strain_blocks (self, fs, Tblock, noise_sqrt_Sh=0, noise_seed=None)
 Generate strain time series of a continuous-wave signal in the detector frame, in contiguous blocks. More...
 
def write_frame_files (self, fs, Tframe, comment="simCW", out_dir=".", noise_sqrt_Sh=0, noise_seed=None)
 Write frame files [1] containing strain time series of a continuous-wave signal. More...
 
def get_sfts (self, fmax, Tsft, noise_sqrt_Sh=0, noise_seed=None, window="rectangular", window_param=0)
 Generate SFTs [2] containing strain time series of a continuous-wave signal. More...
 
def write_sft_files (self, fmax, Tsft, comment="simCW", out_dir=".", noise_sqrt_Sh=0, noise_seed=None, window="rectangular", window_param=0)
 Write SFT files [2] containing strain time series of a continuous-wave signal. More...
 

Constructor & Destructor Documentation

◆ __init__()

def lalpulsar.simulateCW.CWSimulator.__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.

Parameters
trefreference time of signal phase at Solar System barycentre, in GPS seconds (but see tref_at_det)
tstartstart time of signal, in GPS seconds
Tdatatotal duration of signal, in seconds
waveformfunction which computes signal phase and amplitudes as functions of time: dphi, aplus, across = waveform(dt), where: dt = time since reference time tref; dphi = phase of signal at time dt relative to reference time tref, in radians; aplus = strain amplitude of plus polarisation at time dt; across = strain amplitude of cross polarisation at time dt
dt_wfsampling time of the function waveform; this need only be small enough to ensure that dphi, aplus, and across are smoothly interpolated, and does not need to make the desired sampling frequency of the output strain time series
phi0initial phase of the gravitational-wave signal at tstart, in radians
psipolarisation angle of the gravitational-wave source, in radians
alpharight ascension of the gravitational-wave source, in radians
deltadeclination of the gravitational-wave source, in radians
det_namename of the gravitational-wave detector to simulate a response for; e.g. "H1" for LIGO Hanford, "L1" for LIGO Livingston, "V1" for Virgo
earth_ephem_filename of file to load Earth ephemeris from
sun_ephem_filename of file to load Sun ephemeris from
tref_at_detdefault False; if True, shift reference time tref so that dt = 0 is tref in detector frame instead of Solar System barycentre frame, useful if e.g. one wants to turn on signal only for dt > 0, one can use tref as the turn-on time
extra_commentadditional text to add to comment string in frame/SFT headers (not filenames), e.g. for wrapper script commandlines

Definition at line 123 of file simulateCW.py.

Member Function Documentation

◆ get_strain()

def lalpulsar.simulateCW.CWSimulator.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.

Parameters
fssampling frequency of strain time series, in Hz
tminstart time for strain time series, as offsets from self.__tstart
tmaxstart time for strain time series, as offsets from self.__tstart
noise_sqrt_Shif >0, add Gaussian noise with square-root single-sided power spectral density given by this value, in Hz^(-1/2)
noise_seeduse this seed for the random number generator used to create noise; required if noise_sqrt_Sh >0
Returns
(t, h), where: t = start of time strain time series, in GPS seconds; h = strain time series

Definition at line 255 of file simulateCW.py.

◆ get_strain_blocks()

def lalpulsar.simulateCW.CWSimulator.get_strain_blocks (   self,
  fs,
  Tblock,
  noise_sqrt_Sh = 0,
  noise_seed = None 
)

Generate strain time series of a continuous-wave signal in the detector frame, in contiguous blocks.

Parameters
fssampling frequency of strain time series, in Hz
Tblocklength of each block, in seconds; should divide evenly into Tdata
noise_sqrt_Shif >0, add Gaussian noise with square-root single-sided power spectral density given by this value, in Hz^(-1/2)
noise_seeduse this seed for the random number generator used to create noise; if None, generate a random seed using os.urandom()
Returns
(t, h, i, N), where: t = start of time strain time series, in GPS seconds; h = strain time series; i = block index, starting from zero; N = number of blocks

This is a Python generator function and so should be called as follows:

S = CWSimulator(...)
for t, h, i, N in S.get_strain_blocks(...):
...

Definition at line 299 of file simulateCW.py.

◆ write_frame_files()

def lalpulsar.simulateCW.CWSimulator.write_frame_files (   self,
  fs,
  Tframe,
  comment = "simCW",
  out_dir = ".",
  noise_sqrt_Sh = 0,
  noise_seed = None 
)

Write frame files [1] containing strain time series of a continuous-wave signal.

The strain time series is written as double-precision post-processed data (ProcData) channel named <detector>:SIMCW-STRAIN, where <detector> is the 2-character detector prefix (e.g. H1 for LIGO Hanford, L1 for LIGO Livingston, V1 for Virgo).

Parameters
fssampling frequency of strain time series, in Hz
Tframelength of each frame, in seconds; should divide evenly into Tdata
commentframe file name comment, may only contain A-Z, a-z, 0-9, _, +, # characters
out_diroutput directory to write frame files into
noise_sqrt_Shif >0, add Gaussian noise with square-root single-sided power spectral density given by this value, in Hz^(-1/2)
noise_seeduse this seed for the random number generator used to create noise; if None, generate a random seed using os.urandom()
Returns
(file, i, N), where: file = name of frame file just written; i = frame file index, starting from zero; N = number of frame files

This is a Python generator function and so should be called as follows:

S = CWSimulator(...)
for file, i, N in S.write_frame_files(...):
...

[1] https://dcc.ligo.org/LIGO-T970130/public

Definition at line 359 of file simulateCW.py.

◆ get_sfts()

def lalpulsar.simulateCW.CWSimulator.get_sfts (   self,
  fmax,
  Tsft,
  noise_sqrt_Sh = 0,
  noise_seed = None,
  window = "rectangular",
  window_param = 0 
)

Generate SFTs [2] containing strain time series of a continuous-wave signal.

Parameters
fmaxmaximum SFT frequency, in Hz
Tsftlength of each SFT, in seconds; should divide evenly into Tdata
noise_sqrt_Shif >0, add Gaussian noise with square-root single-sided power spectral density given by this value, in Hz^(-1/2)
noise_seeduse this seed for the random number generator used to create noise; if None, generate a random seed using os.urandom()
windowif not None, window the time series before performing the FFT, using the named window function; see XLALCreateNamedREAL8Window()
window_paramparameter for the window function given by window, if needed
Returns
(sft, i, N), where: sft = SFT; i = SFT file index, starting from zero; N = number of SFTs

This is a Python generator function and so should be called as follows:

S = CWSimulator(...)
for sft, i, N in S.get_sfts(...):
...

[2] https://dcc.ligo.org/LIGO-T040164/public

Definition at line 448 of file simulateCW.py.

◆ write_sft_files()

def lalpulsar.simulateCW.CWSimulator.write_sft_files (   self,
  fmax,
  Tsft,
  comment = "simCW",
  out_dir = ".",
  noise_sqrt_Sh = 0,
  noise_seed = None,
  window = "rectangular",
  window_param = 0 
)

Write SFT files [2] containing strain time series of a continuous-wave signal.

Parameters
fmaxmaximum SFT frequency, in Hz
Tsftlength of each SFT, in seconds; should divide evenly into Tdata
commentSFT file name comment, may only contain A-Z, a-z, 0-9 characters
out_diroutput directory to write SFT files into
noise_sqrt_Shif >0, add Gaussian noise with square-root single-sided power spectral density given by this value, in Hz^(-1/2)
noise_seeduse this seed for the random number generator used to create noise; if None, generate a random seed using os.urandom()
windowif not None, window the time series before performing the FFT, using the named window function; see XLALCreateNamedREAL8Window()
window_paramparameter for the window function given by window, if needed
Returns
(file, i, N), where: file = name of SFT file just written; i = SFT file index, starting from zero; N = number of SFT files

This is a Python generator function and so should be called as follows:

S = CWSimulator(...)
for file, i, N in S.write_sft_files(...):
...

[2] https://dcc.ligo.org/LIGO-T040164/public

Definition at line 515 of file simulateCW.py.