gravelamps.waveform.signal_generation¶
Handles the generation of signals from data.
- class gravelamps.waveform.signal_generation.ImageMetaData(image_data: dict)¶
Bases:
objectHolds data on the image.
- Parameters:
- image_data: dict
Image specific settings
- Attributes:
calibration_modelThe form of calibration to be applied to the detectors.
channel_dictChannels for reading data.
data_filesFrame files for the singal.
detectorsList of the detectors for the signal.
durationDuration of the signal.
gaussian_noiseWhether the signal should be injected into gaussian noise.
generator_classString name for the waveform generator class.
injectionWhether the specified image is an injection.
injection_parametersParameters for signal injection.
post_trigger_durationAmount of post-merger time in signal.
psd_durationDuration of the PSD curve.
psd_filesPSD files for each of the detectors.
sampling_frequencySampling rate for the signal.
seedSeed from the metadata.
source_modelString name for the frequency domain source model.
spline_calibration_nodesNumber of nodes for the spline calibration.
start_timeGPS Start time for the signal.
trigger_timeTrigger time of the signal.
waveform_argumentsKeyword arguments to waveform generator.
zero_noiseWhether the signal should be injected into zero noise.
Methods
maximum_frequency([ifo])Gets the maximum frequency.
minimum_frequency([ifo])Gets the minimum frequency.
- property calibration_model: str¶
The form of calibration to be applied to the detectors.
- property channel_dict: dict¶
Channels for reading data.
- property data_files: dict¶
Frame files for the singal.
- property detectors: list[str]¶
List of the detectors for the signal.
- property duration: float¶
Duration of the signal.
- property gaussian_noise: bool¶
Whether the signal should be injected into gaussian noise.
- property generator_class: str¶
String name for the waveform generator class.
- property injection: bool¶
Whether the specified image is an injection. If not present in metadata defaults to False.
- property injection_parameters: dict¶
Parameters for signal injection.
- maximum_frequency(ifo: str = None) dict | float¶
Gets the maximum frequency.
- Parameters:
- ifo: str, optional, default=None
If frequencies given as dict, will return this key.
- Raises:
- KeyError
If ifo is given, the maximum frequency is given as a dictionary and the interferometer is not in the dictionary.
- minimum_frequency(ifo: str = None) dict | float¶
Gets the minimum frequency.
- Parameters:
- ifo: str, optional, default=None
If frequencies given as dict, will return this key.
- Raises:
- KeyError
If ifo is given, the minimum frequency is given as a dictionary and the interferometer is not in the dictionary.
- property post_trigger_duration: float¶
Amount of post-merger time in signal.
- property psd_duration: float¶
Duration of the PSD curve. If not in metadata is set to 32 * signal duration.
- property psd_files: dict¶
PSD files for each of the detectors.
- property sampling_frequency: int¶
Sampling rate for the signal.
- property seed: int¶
Seed from the metadata. Defaults to None.
- property source_model: str¶
String name for the frequency domain source model.
- property spline_calibration_nodes: int¶
Number of nodes for the spline calibration.
- property start_time: float¶
GPS Start time for the signal.
- property trigger_time: int¶
Trigger time of the signal.
- property waveform_arguments: dict¶
Keyword arguments to waveform generator.
- property zero_noise: bool¶
Whether the signal should be injected into zero noise.
- class gravelamps.waveform.signal_generation.ModelMetaData(model_settings: dict)¶
Bases:
objectHolds model specific data.
- Parameters:
- model_settings: dict
Model specific settings
- Attributes:
generator_classThe string path of the waveform generator class.
source_modelString path of the frequency domain source model.
Methods
waveform_arguments(image)Get the waveform arguments dictionary combining the model defaults with the image specific settings.
- property generator_class: str¶
The string path of the waveform generator class. Default is SingleImageGenerator.
- property source_model: str¶
String path of the frequency domain source model. Default is lal_binary_black_hole.
- waveform_arguments(image: ImageMetaData) dict¶
Get the waveform arguments dictionary combining the model defaults with the image specific settings.
- Parameters:
- image: ImageMetaData
Image specific settings
- Returns:
- waveform_arguments: dict
Arguments to provide to the waveform.
- gravelamps.waveform.signal_generation.get_generator_class(generator_string: str) Callable¶
Gets the waveform generator class from a string.
- Parameters:
- generator_string: str
Full python path to object or path relative to gravelamps.waveform.waveform_generator.
- Returns:
- Callable
Constructor for waveform generator class.
- gravelamps.waveform.signal_generation.get_source_model(model_string: str) Callable¶
Gets the frequency domain source model from a string.
- Parameters:
- model_string: str
Full python path to model or path relative to bilby.gw.source.
- Returns:
- Callable
Frequency domain source model function
- gravelamps.waveform.signal_generation.make_model_generators(model_settings: dict, metadata: dict) list[WaveformGenerator]¶
Make the model specific waveform generators.
- Parameters:
- model_settings: dict
Model specific settings.
- metadata: dict
Event specific settings.
- Returns:
- generators: list[WaveformGenerator]
Model specific generators for each image in order.
- gravelamps.waveform.signal_generation.make_signals(metadata: dict) list[InterferometerList]¶
Generates multi-image signal data.
- Parameters:
- metadata: dict
Event specific settings.
- Returns:
- interferometers: list[InterferometerList]
Contains interferometeric data for each signal in time order.
- gravelamps.waveform.signal_generation.set_calibration(image: ImageMetaData, ifo: Interferometer)¶
Sets the calibration model for the detector.
- Parameters:
- image: ImageMetaData
Image specific information.
- ifo: Interferometer
Interferometer Object
- gravelamps.waveform.signal_generation.set_psd(image: ImageMetaData, ifo: Interferometer)¶
Sets the PSD of the Interfometer.
- Parameters:
- image: ImageMetaData
Image specific information.
- ifo: Interferometer
Interferometer Object.
- gravelamps.waveform.signal_generation.set_signal(image: ImageMetaData, ifo: Interferometer, generator: WaveformGenerator = None)¶
Sets the signal for the Interferometer.
- Parameters:
- imageImageMetaData
Image specific settings.
- ifoInterferomter
Interferometer Object.
- generatorWaveformGenerator, optional, default=None
Waveform generator for producing injected signals.
- Raises:
- ValueError
If image is injection and generator not given.