Commit 3fcc23dc authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Fix bug in naming convention for waveform_approximant

parent 67914930
......@@ -925,9 +925,9 @@ class ROQGravitationalWaveTransient(GravitationalWaveTransient):
"""
# Maximum delay time to geocentre plus 10%
earth_light_crossing_time = 1.1 * radius_of_earth / speed_of_light
time_space = self._get_time_resolution()
# Maximum delay time to geocentre + 5 steps
earth_light_crossing_time = radius_of_earth / speed_of_light + 5 * time_space
delta_times = np.arange(
self.priors['geocent_time'].minimum - earth_light_crossing_time,
self.priors['geocent_time'].maximum + earth_light_crossing_time,
......@@ -963,18 +963,29 @@ class ROQGravitationalWaveTransient(GravitationalWaveTransient):
ifo.name, len(overlap_frequencies),
min(overlap_frequencies), max(overlap_frequencies)))
logger.debug("Preallocate array")
tc_shifted_data = np.zeros((
len(self.weights['time_samples']), len(overlap_frequencies)),
dtype=complex)
logger.debug("Calculate shifted data")
data = ifo.frequency_domain_strain[ifo.frequency_mask][ifo_idxs]
tc_shifted_data = data * np.exp(
2j * np.pi * overlap_frequencies * time_samples[:, np.newaxis])
prefactor = (
data /
ifo.power_spectral_density_array[ifo.frequency_mask][ifo_idxs]
)
for j in range(len(self.weights['time_samples'])):
tc_shifted_data[j] = prefactor * np.exp(
2j * np.pi * overlap_frequencies * time_samples[j])
# to not kill all computers this minimises the memory usage of the
# required inner products
max_block_gigabytes = 4
max_elements = int((max_block_gigabytes * 2 ** 30) / 8)
logger.debug("Apply dot product")
self.weights[ifo.name + '_linear'] = blockwise_dot_product(
tc_shifted_data /
ifo.power_spectral_density_array[ifo.frequency_mask][ifo_idxs],
tc_shifted_data,
linear_matrix[roq_idxs],
max_elements) * 4 / ifo.strain_data.duration
......
......@@ -382,7 +382,7 @@ def _base_roq_waveform(
frequency_nodes_quadratic = waveform_arguments['frequency_nodes_quadratic']
reference_frequency = waveform_arguments['reference_frequency']
approximant = lalsim_GetApproximantFromString(
waveform_arguments['approximant'])
waveform_arguments['waveform_approximant'])
luminosity_distance = luminosity_distance * 1e6 * utils.parsec
mass_1 = mass_1 * utils.solar_mass
......
......@@ -73,7 +73,7 @@ search_waveform_generator = bilby.gw.waveform_generator.WaveformGenerator(
waveform_arguments=dict(
frequency_nodes_linear=freq_nodes_linear,
frequency_nodes_quadratic=freq_nodes_quadratic,
reference_frequency=20. * scale_factor, approximant='IMRPhenomPv2'),
reference_frequency=20. * scale_factor, waveform_approximant='IMRPhenomPv2'),
parameter_conversion=bilby.gw.conversion.convert_to_lal_binary_black_hole_parameters)
# Here we add constraints on chirp mass and mass ratio to the prior, these are
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment