gw.noise.asd_dataset.ASDDataset

gw.noise.asd_dataset.ASDDataset(
    file_name=None,
    dictionary=None,
    ifos=None,
    precision=None,
    domain_update=None,
)

Dataset of amplitude spectral densities (ASDs). The ASDs are typically used for whitening strain data, and additionally passed as context to the neural density estimator.

Parameters

Name Type Description Default
file_name str HDF5 file containing a dataset None
dictionary dict Contains settings and data entries. The dictionary keys should be ‘settings’, ‘asds’, and ‘gps_times’. None
ifos List[str] List of detectors used for dataset, e.g. [‘H1’, ‘L1’]. If not set, all available ones in the dataset are used. None
precision str(single, double) If provided, changes precision of loaded dataset. None
domain_update dict If provided, update domain from existing domain using new settings. None

Attributes

Name Description
dataset_type
domain
gps_info Min/Max GPS time for each detector.
length_info The number of asd samples per detector.
precision

Methods

Name Description
sample_random_asds Sample n random ASDs for each detector.
save_psd
update_domain Update the domain based on new configuration. Also adjust data arrays to match

sample_random_asds

gw.noise.asd_dataset.ASDDataset.sample_random_asds(n=None)

Sample n random ASDs for each detector.

Parameters

Name Type Description Default
n int Number of asds to sample None

Returns

Name Type Description
dict[str, np.ndarray] Where the keys correspond to the detectors and the values are arrays of shape (n, D) where D is the number of frequency bins and n is the number of ASDs requested. If n=None, then the function returns a single ASD for each detector, so the array is flattened to be shape D

save_psd

gw.noise.asd_dataset.ASDDataset.save_psd(
    directory,
    ifo_name,
    idx=None,
    rng=None,
)

update_domain

gw.noise.asd_dataset.ASDDataset.update_domain(domain_update)

Update the domain based on new configuration. Also adjust data arrays to match the new domain.

The ASD dataset provides ASDs in a particular domain. In Frequency domain, this is [0, domain.f_max]. In practice one may want to train a network based on slightly different domain settings, which corresponds to truncating the likelihood integral.

This method provides functionality for that. It truncates the data below a new f_max, and sets the ASD below f_min to a large but finite value.

Parameters

Name Type Description Default
domain_update dict Settings dictionary. Must contain a subset of the keys contained in domain_dict. required