pygwb.network.Network

class pygwb.network.Network(name, interferometers, duration=None, frequencies=None, calibration_epsilon=0, notch_list_path='', coarse_grain_psd=False, coarse_grain_csd=True, overlap_factor_welch=0.5, overlap_factor=0.5, window_fftgram_dict={'window_fftgram': 'hann'}, window_fftgram_dict_welch={'window_fftgram': 'hann'}, N_average_segments_psd=2)[source]

Bases: object

__init__(name, interferometers, duration=None, frequencies=None, calibration_epsilon=0, notch_list_path='', coarse_grain_psd=False, coarse_grain_csd=True, overlap_factor_welch=0.5, overlap_factor=0.5, window_fftgram_dict={'window_fftgram': 'hann'}, window_fftgram_dict_welch={'window_fftgram': 'hann'}, N_average_segments_psd=2)[source]

Instantiate a Network object.

Parameters:
  • name (str) – Name for the network, e.g H1H2.

  • interferometers (list) – List of intereferometer objects.

  • duration (float, optional) – The duration in seconds of each data segment in the interferometers. None by default, in which case duration is inherited from the interferometers.

  • frequencies (array_like, optional) – The frequency array for the Baseline and interferometers.

  • calibration_epsilon (float, optional) – Calibration uncertainty for this baseline – currently only supports a single notch list for all baselines. Defaults to 0.

  • notch_list_path (str, optional) – File path of the baseline notch list – currently only supports a single notch list for all baselines. Defaults to empty path.

  • coarse_grain_psd (bool, optional) – Indicates whether PSD should be coarse-grained or not. Defaults to False, in which case the PSD will be Welch averaged.

  • coarse_grain_csd (bool, optional) – Indicates whether CSD should be coarse-grained or not. Defaults to True. If False, the CSD will be Welch averaged.

  • overlap_factor_welch (float, optional) – Factor by which to overlap the segments in the psd and csd estimation. Default is 1/2, if set to 0, no overlap is performed.

  • overlap_factor (float, optional) – Factor by which to overlap the segments in the psd and csd estimation. Default is 1/2, if set to 0, no overlap is performed.

  • window_fftgram_dict (dictionary, optional) – Dictionary containing name and parameters describing which window to use when producing fftgrams for psds and csds. Default is “hann”.

  • window_fftgram_dict_welch (dictionary, optional) – Dictionary containing name and parameters describing which window to use when producing fftgrams for psds and csds using the Welch average method. Default is “hann”.

  • N_average_segments_psd (int, optional) – Number of segments used for PSD averaging (from both sides of the segment of interest). N_avg_segs should be even and >= 2.

See also

pygwb.baseline.Baseline

Used to create the various baselines corresponding to the detectors in the network.

__call__(*args, **kwargs)

Call self as a function.

Methods

__init__(name, interferometers[, duration, ...])

Instantiate a Network object.

combine_point_estimate_sigma_spectra()

Combines the point estimate and sigma spectra from different baselines in the Network and stores them as attributes.

from_baselines(name, baselines)

Initialise a network from a set of baselines.

save_interferometer_data_to_file([save_dir, ...])

Save interferometer strain data to a file.

set_duration(duration)

Sets the duration for the Network and Interferometers.

set_frequency_mask([notch_list_path, flow, ...])

Set frequency mask to frequencies attribute.

set_interferometer_data_from_simulator(...)

Fill interferometers with data from simulation.

set_point_estimate_sigma([notch_list_path, ...])

Set point estimate sigma based the combined spectra from each Baseline.

combine_point_estimate_sigma_spectra()[source]

Combines the point estimate and sigma spectra from different baselines in the Network and stores them as attributes.

classmethod from_baselines(name, baselines)[source]

Initialise a network from a set of baselines. Takes care to unpack the interferometers from each baseline and sets them in the network.

Parameters:
  • name (str) – Name of the network.

  • baselines (list) – List of pygwb.baseline objects.

Returns:
network: pygwb.network

Network object

save_interferometer_data_to_file(save_dir='./', file_format='hdf5')[source]

Save interferometer strain data to a file. This method relies on the gwpy TimeSeries.write method. Typically used when simulating a signal for a whole network of interferometers.

Parameters:
  • save_dir (str, optional) – The path of the output folder. Defaults to the local folder.

  • file_format (str, optional) – The format of the output file. Defaults to hdf5 file. Acceptable formats are standard gwpy TimeSeries.write formats.

See also

gwpy.timeseries.TimeSeriesDict

More information here.

Notes

This will save a single frame file with a set of interferometer data; each strain channel is labelled by its interferometer.

set_duration(duration)[source]

Sets the duration for the Network and Interferometers.

Parameters:

duration (float, optional) – The duration to set for the Network and interferometers.

Notes

The cross-checks that durations match in all the interferometers are done by each baseline.

set_frequency_mask(notch_list_path='', flow=20, fhigh=1726)[source]

Set frequency mask to frequencies attribute.

Parameters:
  • notch_list_path (str) – Path to notch list to apply to frequency array.

  • flow (float, optional) – Lowest frequency to consider. Defaults to 20 Hz.

  • fhigh (float, optional) – Highest frequency to consider. Defaults to 1726 Hz.

See also

pygwb.notch.StochNotchList

Used to read in the frequency notches.

set_interferometer_data_from_simulator(N_segments, GWB_intensity=None, CBC_dict=None, sampling_frequency=None, start_time=None, inject_into_data_flag=False)[source]

Fill interferometers with data from simulation. Data can already be present in the intereferometers of the network, in which case the simulated data will be injected on top of the data already present.

Parameters:
  • N_segments (int) – Number of segments to simulate.

  • GWB_intensity (gwpy.frequencyseries.FrequencySeries, optional) – A gwpy.frequencyseries.FrequencySeries containing the desired strain power spectrum. Defaults to None, in which case CBC_dict should be passed.

  • CBC_dict (dict, optional) – Dictionary containing the parameters of CBC injections. Default to None, in which case GWB_intensity should be passed.

  • sampling_frequency (float, optional) – Sampling frequency at which the data needs to be simulated. If not specified (None), will check for interferometer’s sampling frequency.

  • start_time (float, optional) – Start time of the simulated data. If not passed (None), will check for interferometer’s timeseries start time. If not specified either, start time will default to 0.

  • inject_into_data_flag (bool, optional) – Flag that specifies whether or not the simulated data needs to be injected into data, i.e. if there is already data present in the interferometers of the network. If so, only data will be simulated and no extra noise will be added on top of the simulated data. Defaults to False.

See also

pygwb.simulator.Simulator

Used to simulate data.

set_point_estimate_sigma(notch_list_path='', flow=20, fhigh=1726)[source]

Set point estimate sigma based the combined spectra from each Baseline. This is the estimate of omega_gw in each frequency bin.

Parameters:
  • notch_list_path (str, optional) – Path to the notch list to use in the spectrum; if the notch_list isn’t set in the baseline, user can pass it directly here. If it is not set and if none is passed no notches will be applied.

  • flow (float, optional) – Low frequency. Default is 20 Hz.

  • fhigh (float, optional) – High frequency. Default is 1726 Hz.