fast_lisa_subtraction.simulation.catalog module
- class fast_lisa_subtraction.simulation.catalog.SourceCatalog(catalog_path=None, catalog_df=None, use_gpu=True, verbose=True, **gbgpu_kwargs)[source]
Bases:
objectGenerate GW waveforms from a Galactic binary catalogue.
- Parameters:
catalog_path (str or os.PathLike, optional) – Path to the catalogue file. Used if
catalog_dfis not provided.catalog_df (pandas.DataFrame, optional) – In-memory catalogue. If provided,
catalog_pathis ignored.use_gpu (bool, optional) – If True, attempt to use CuPy for GPU acceleration.
verbose (bool, optional) – If True, enable progress and status logging.
**gbgpu_kwargs (dict) – Additional keyword arguments forwarded to
gbgpu.gbgpu.GBGPU.
- property Nbinaries
Number of binaries in the catalogue.
- Returns:
Number of rows in the catalogue.
- Return type:
int
- static compute_total_snr(AET, PSD, f, wvf_freqs)[source]
Compute the network SNR in A/E/T channels.
- Parameters:
AET (dict) – Dictionary containing waveforms in the A/E/T channels.
PSD (dict) – Dictionary containing noise PSDs for the A/E/T channels.
f (numpy.ndarray or cupy.ndarray) – Frequency array for the noise PSD.
wvf_freqs (numpy.ndarray or cupy.ndarray) – Batched frequency arrays for the waveforms.
- Returns:
Total network SNR for each waveform.
- Return type:
numpy.ndarray or cupy.ndarray
Notes
The per-channel SNR is computed as
\[\mathrm{SNR}_X = 4\,\Delta f \sum_k \frac{|h_X(f_k)|^2}{S_X(f_k)},\]and the network SNR is
\[\mathrm{SNR} = \sqrt{\mathrm{SNR}_A + \mathrm{SNR}_E + \mathrm{SNR}_T}.\]
- generate_catalogue(Nbatch=10000, Nmax_binaries=None, Tobs=1, AET=True, outdir=None, save=True, snr_threshold=None, noise_model='SciRDv1', duty_cycle=1, **gbgpu_kwargs)[source]
Generate waveforms for the full catalogue.
- Parameters:
Nbatch (int, optional) – Number of binaries per batch.
Nmax_binaries (int or None, optional) – Maximum number of binaries to generate. If None, the full catalogue is used; otherwise a random subset is sampled.
Tobs (float, optional) – Observation time in years.
AET (bool, optional) – If True, generate A/E/T channels; otherwise X/Y/Z.
outdir (str or os.PathLike or None, optional) – Output directory. If None, uses the catalogue directory.
save (bool, optional) – If True, save waveforms and catalogue to HDF5.
snr_threshold (float or None, optional) – Threshold SNR for detectability cuts. If None, no cut is applied.
noise_model (str, optional) – Noise model name passed to
get_noise_model.duty_cycle (float, optional) – Detector duty cycle.
**gbgpu_kwargs (dict) – Additional arguments forwarded to
GBGPU.run_wave.
- Returns:
Dictionary containing the sum of generated waveforms for each TDI channel along with metadata.
- Return type:
dict
- generate_template(params, dt, Tobs, channels, **gbgpu_kwargs)[source]
Generate waveforms for a batch of binaries.
- Parameters:
params (numpy.ndarray or cupy.ndarray) – Array containing the parameters of the binaries.
dt (float) – Data cadence in seconds.
Tobs (float) – Observation time in seconds.
channels (list of str) – TDI channels to generate.
**gbgpu_kwargs (dict) – Additional arguments forwarded to
GBGPU.run_wave.
- Returns:
(batch_freqs, ch_wvfs)wherebatch_freqsis the frequency array for each waveform andch_wvfsis a dictionary of channel waveforms.- Return type:
tuple
- static get_batch_params(cat_df, index)[source]
Extract parameter arrays for a batch of binaries.
- Parameters:
cat_df (pandas.DataFrame) – Catalogue containing binary parameters.
index (array-like) – Indices of the rows to extract.
- Returns:
Array of shape
(9, N)with parameters ordered as[amp, f0, fdot, fddot, phi0, iota, psi, lam, beta_sky].- Return type:
numpy.ndarray
- static get_frequency_array(Tobs, dt, min_freq=None, max_freq=None)[source]
Construct a frequency array for a given observation time and cadence.
- Parameters:
Tobs (float) – Observation time in seconds.
dt (float) – Sampling cadence in seconds.
min_freq (float or None, optional) – Minimum frequency to include.
max_freq (float or None, optional) – Maximum frequency to include.
- Returns:
Frequency array spanning the requested range.
- Return type:
numpy.ndarray or cupy.ndarray
- save_catalogue(outdir, cat, sum_wvf, Nbinaries)[source]
Save generated waveform and source catalogues to HDF5.
- Parameters:
outdir (str or os.PathLike or None) – Output directory. If None, the catalogue directory is used.
cat (pandas.DataFrame) – Source catalogue to save.
sum_wvf (dict) – Summed waveform dictionary, including metadata entries.
Nbinaries (int) – Total number of binaries used in the simulation.
- Return type:
None