Skip to content
Snippets Groups Projects
Commit 2002b326 authored by Aditya Vijaykumar's avatar Aditya Vijaykumar
Browse files

changes to interferometer.py

parent 7ee82430
No related branches found
No related tags found
1 merge request!1105Relative Binning in bilby
......@@ -323,6 +323,52 @@ class Interferometer(object):
return signal_ifo
def get_detector_response_relative_binning(self, waveform_polarizations,
parameters, bin_frequencies):
"""Get the detector response for a particular waveform, where the frequencies
of the waveform polarizations are only the binning frequencies and we
assume that there is no frequency mask necessary for the data. Kind of
a hacky workaround. Should do something better probably.
Parameters
-------
waveform_polarizations: dict
polarizations of the waveform
parameters: dict
parameters describing position and time of arrival of the signal
Returns
-------
array_like: A 3x3 array representation of the detector response (signal observed in the interferometer)
"""
signal = {}
for mode in waveform_polarizations.keys():
det_response = self.antenna_response(
parameters['ra'],
parameters['dec'],
parameters['geocent_time'],
parameters['psi'], mode)
signal[mode] = waveform_polarizations[mode] * det_response
signal_ifo = sum(signal.values())
time_shift = self.time_delay_from_geocenter(
parameters['ra'], parameters['dec'], parameters['geocent_time'])
# Be careful to first substract the two GPS times which are ~1e9 sec.
# And then add the time_shift which varies at ~1e-5 sec
dt_geocent = parameters['geocent_time'] - self.strain_data.start_time
dt = dt_geocent + time_shift
signal_ifo = signal_ifo * \
np.exp(-1j * 2 * np.pi * dt * bin_frequencies)
signal_ifo *= self.calibration_model.get_calibration_factor(
bin_frequencies, prefix='recalib_{}_'.format(self.name),
**parameters)
return signal_ifo
def check_signal_duration(self, parameters, raise_error=True):
""" Check that the signal with the given parameters fits in the data
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment