From 493b888024aa38ef8f32792d03d8a111a15d0d0d Mon Sep 17 00:00:00 2001 From: Alex Correia Date: Tue, 10 Dec 2024 12:30:59 -0500 Subject: [PATCH] add controls for applying time offset in space det initialization --- pycbc/inject/inject.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pycbc/inject/inject.py b/pycbc/inject/inject.py index abe23ac12ae..5801f21cf0e 100644 --- a/pycbc/inject/inject.py +++ b/pycbc/inject/inject.py @@ -42,10 +42,11 @@ from pycbc.waveform import ringdown_td_approximants from pycbc.types import float64, float32, TimeSeries, load_timeseries from pycbc.detector import (Detector, SpaceDetector, _space_detectors, - get_available_space_detectors, parse_det_name) + get_available_space_detectors, parse_det_name) from pycbc.conversions import (tau0_from_mass1_mass2, get_final_from_initial, tau_from_final_mass_spin) +from pycbc.coordinates.space import TIME_OFFSET_20_DEGREES from pycbc.filter import resample_to_delta_t import pycbc.io from pycbc.io.ligolw import LIGOLWContentHandler @@ -89,7 +90,17 @@ def projector(detector_name, inj, hp, hc, distance_scale=1): detector frame """ if detector_name in get_available_space_detectors(): - detector = SpaceDetector(detector_name) + # FIXME : This should probably be moved to project_wave; + # wait on code reviews to see if this is OK here + apply_offset = False + offset = TIME_OFFSET_20_DEGREES + if 'apply_offset' in inj.dtype.names: + apply_offset = inj.apply_offset + if 'offset' in inj.dtype.names: + offset = inj.offset + detector = SpaceDetector(detector_name, + apply_offset=apply_offset, + offset=offset) else: detector = Detector(detector_name)