dingo.gw.data package

Submodules

dingo.gw.data.data_download module

dingo.gw.data.data_download.download_psd(det, time_start, time_psd, window, f_s)

Download strain data and generate a PSD based on these. Use num_segments of length time_segment, starting at GPS time time_start.

Parameters:
  • det (str) – detector

  • time_start (float) – start GPS time for PSD estimation

  • time_psd (float = 1024) – time in seconds for strain used for PSD generation

  • window (Union(np.ndarray, dict)) – Window used for PSD generation, needs to be the same as used for Fourier transform of event strain data. Provided as dict, window is generated by window = dingo.gw.gwutils.get_window( **window).

  • f_s (float) – sampling rate of strain data

Returns:

psd – array of psd

Return type:

np.array

dingo.gw.data.data_download.download_raw_data(time_event, time_segment, time_psd, time_buffer, detectors, window, f_s)

dingo.gw.data.data_preparation module

dingo.gw.data.data_preparation.data_to_domain(raw_data, settings_raw_data, domain, **kwargs)
Parameters:
  • raw_data

  • settings_raw_data

  • model_metadata

Returns:

data – dict with domain_data

Return type:

dict

dingo.gw.data.data_preparation.get_event_data_and_domain(model_metadata, time_event, time_psd, time_buffer, event_dataset=None)
dingo.gw.data.data_preparation.load_raw_data(time_event, settings, event_dataset=None)

Load raw event data.

  • If event_dataset is provided and event data is saved in it, load and return the data

  • Else, event data is downloaded. If event_dataset is provided, the event data is additionally saved to the file.

Parameters:
  • time_event (float) – gps time of the events

  • settings (dict) – dict with the settings

  • event_dataset (str) – name of the event dataset file

dingo.gw.data.data_preparation.parse_settings_for_raw_data(model_metadata, time_psd, time_buffer)

dingo.gw.data.event_dataset module

class dingo.gw.data.event_dataset.EventDataset(file_name=None, dictionary=None)

Bases: DingoDataset

Dataset class for storing single event.

For constructing, provide either file_name, or dictionary containing data and settings entries, or neither.

Parameters:
  • file_name (str) – HDF5 file containing a dataset

  • dictionary (dict) – Contains settings and data entries. The data keys should be the same as save_keys

  • data_keys (list) – Variables that should be saved / loaded. This allows for class to store additional variables beyond those that are saved. Typically, this list would be provided by any subclass.

  • leave_on_disk_keys (Optional[list]) – Keys for which the values are not loaded into RAM when initializing the dataset. This reduces the memory footprint during training. Instead, the values are loaded from the HDF5 file during training.

dataset_type = 'event_dataset'

Module contents