Skip to content
Snippets Groups Projects

Minor adjust to the ROQ weight generation

Merged Gregory Ashton requested to merge minor-adjustments-to-roq-weights into master
+ 5
17
@@ -875,7 +875,7 @@ class ROQGravitationalWaveTransient(GravitationalWaveTransient):
d_inner_h = interp1d(
self.weights['time_samples'][indices],
d_inner_h_tc_array, kind='cubic')(ifo_time)
d_inner_h_tc_array, kind='cubic', assume_sorted=True)(ifo_time)
optimal_snr_squared = \
np.vdot(np.abs(h_plus_quadratic + h_cross_quadratic)**2,
@@ -960,21 +960,9 @@ class ROQGravitationalWaveTransient(GravitationalWaveTransient):
ifo.name, len(overlap_frequencies),
min(overlap_frequencies), max(overlap_frequencies)))
# array to be filled with data, shifted by discrete time_samples
tc_shifted_data = np.zeros([
len(self.weights['time_samples']), len(overlap_frequencies)],
dtype=complex)
# shift data to beginning of the prior increment by the time step
shifted_data =\
ifo.frequency_domain_strain[ifo.frequency_mask][ifo_idxs] * \
np.exp(2j * np.pi * overlap_frequencies *
self.weights['time_samples'][0])
single_time_shift = np.exp(
2j * np.pi * overlap_frequencies * time_space)
for j in range(len(self.weights['time_samples'])):
tc_shifted_data[j] = shifted_data
shifted_data *= single_time_shift
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])
# to not kill all computers this minimises the memory usage of the
# required inner products
@@ -987,7 +975,7 @@ class ROQGravitationalWaveTransient(GravitationalWaveTransient):
linear_matrix[roq_idxs],
max_elements) * 4 / ifo.strain_data.duration
del tc_shifted_data, shifted_data, single_time_shift, overlap_frequencies
del tc_shifted_data, overlap_frequencies
gc.collect()
self.weights[ifo.name + '_quadratic'] = build_roq_weights(
Loading