Skip to content

Commit

Permalink
Indentation fix in init
Browse files Browse the repository at this point in the history
  • Loading branch information
acorreia61201 committed Aug 30, 2024
1 parent b36b378 commit 3b99cd3
Showing 1 changed file with 17 additions and 21 deletions.
38 changes: 17 additions & 21 deletions pycbc/detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,28 +662,28 @@ class LISA_detector(object):
"""
LISA-like GW detector. Applies detector response from FastLISAResponse.
"""
def __init__(self, detector='LISA', reference_time=None, orbits=None, use_gpu=False, t0=10000.):
def __init__(self, detector='LISA', reference_time=None, orbits=None, use_gpu=False, t0=None):
"""
Parameters
----------
detector: str (optional)
String specifying space-borne detector. Currently only accepts 'LISA',
String specifying space-borne detector. Currently only accepts 'LISA',
which is the default setting.
reference_time: float (optional)
The GPS start time of signal in the SSB frame. Default to start time of
The GPS start time of signal in the SSB frame. Default to start time of
orbits input.
orbits: lisatools.detector.Orbits (optional)
Orbital information to pass into pyResponseTDI. Default
Orbital information to pass into pyResponseTDI. Default
lisatools.detector.ESAOrbits.
use_gpu : bool (optional)
Specify whether to run class on GPU support via CuPy. Default False.
t0 : float (optional)
Time length (in seconds) to cut from start and end of TDI observables. By
default, TDI channels will have erroneous noise at edges that will be cut
Time length (in seconds) to cut from start and end of TDI observables. By
default, TDI channels will have erroneous noise at edges that will be cut
according to this argument. Default 10000 s.
"""
# initialize detector; for now we only accept LISA
Expand Down Expand Up @@ -711,11 +711,11 @@ def __init__(self, detector='LISA', reference_time=None, orbits=None, use_gpu=Fa
self.n = None
self.pad_idx = None
self.response_init = None

if t0 is None:
self.t0 = 10000.
else:
self.t0 = t0
else:
self.t0 = t0

# initialize whether to use gpu; FLR has handles if this cannot be done
self.use_gpu = use_gpu
Expand Down Expand Up @@ -748,7 +748,7 @@ def apply_polarization(self, hp, hc, polarization):

return hp_ssb, hc_ssb

def get_links(self, hp, hc, lamb, beta, polarization=0, reference_time=None,
def get_links(self, hp, hc, lamb, beta, polarization=0, reference_time=None,
use_gpu=None, tdi=2):
"""
Project a radiation frame waveform to the LISA constellation.
Expand All @@ -773,12 +773,12 @@ def get_links(self, hp, hc, lamb, beta, polarization=0, reference_time=None,
The polarization angle of the GW in radians. Default 0.
reference_time : float (optional)
The GPS start time of the GW signal in the SSB frame. Default to
The GPS start time of the GW signal in the SSB frame. Default to
input on class initialization.
use_gpu : bool (optional)
Flag whether to use GPU support. Default to class input.
CuPy is required if use_gpu is True; an ImportError will be raised
CuPy is required if use_gpu is True; an ImportError will be raised
if CuPy could not be imported.
tdi : int (optional)
Expand All @@ -805,8 +805,6 @@ def get_links(self, hp, hc, lamb, beta, polarization=0, reference_time=None,
self.sample_times = hp.sample_times.numpy()

# rescale the orbital time series to match waveform
### requires bugfix in LISAanalysistools to function
### awaiting response from dev team for formal release
self.orbits.configure(t_arr=self.sample_times)

# rotate GW from radiation frame to SSB using polarization angle
Expand Down Expand Up @@ -842,7 +840,7 @@ def get_links(self, hp, hc, lamb, beta, polarization=0, reference_time=None,

if self.response_init is None:
# initialize the class
response_init = pyResponseTDI(1/dt, n, orbits=self.orbits,
response_init = pyResponseTDI(1/dt, n, orbits=self.orbits,
use_gpu=use_gpu, tdi=tdi_opt)
self.response_init = response_init
else:
Expand All @@ -863,7 +861,7 @@ def get_links(self, hp, hc, lamb, beta, polarization=0, reference_time=None,

return wf_proj

def project_wave(self, hp, hc, lamb, beta, polarization, reference_time=None, tdi=2,
def project_wave(self, hp, hc, lamb, beta, polarization, reference_time=None, tdi=2,
tdi_chan='AET', tdi_orbits=None, use_gpu=None, remove_garbage=False):
"""
Evaluate the TDI observables.
Expand All @@ -886,7 +884,7 @@ def project_wave(self, hp, hc, lamb, beta, polarization, reference_time=None, td
The polarization angle of the GW in radians.
reference_time : float (optional)
The GPS start time of the GW signal in the SSB frame. Default to
The GPS start time of the GW signal in the SSB frame. Default to
value in input signals hp and hc.
tdi : int (optional)
Expand All @@ -898,7 +896,7 @@ def project_wave(self, hp, hc, lamb, beta, polarization, reference_time=None, td
Default 'AET'.
tdi_orbits : lisatools.detector.Orbits (optional)
Orbit keywords specifically for TDI generation. Default to class
Orbit keywords specifically for TDI generation. Default to class
input.
use_gpu : bool (optional)
Expand All @@ -920,7 +918,7 @@ def project_wave(self, hp, hc, lamb, beta, polarization, reference_time=None, td
use_gpu = self.use_gpu

# generate the Doppler time series
self.get_links(hp, hc, lamb, beta, polarization=polarization, reference_time=reference_time,
self.get_links(hp, hc, lamb, beta, polarization=polarization, reference_time=reference_time,
use_gpu=use_gpu, tdi=tdi)

# set TDI channels
Expand All @@ -932,8 +930,6 @@ def project_wave(self, hp, hc, lamb, beta, polarization, reference_time=None, td
# if TDI orbit class is provided, update the response_init
# tdi_orbits are set to class input automatically by FLR otherwise
if tdi_orbits is not None:
### requires bugfix in LISAanalysistools to function
### awaiting response from dev team for formal release
tdi_orbits.configure(t_arr=self.sample_times)
self.response_init.tdi_orbits = tdi_orbits

Expand Down

0 comments on commit 3b99cd3

Please sign in to comment.