Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify injection module to support space-based detector class #4982

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pycbc/detector/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
from .ground import *
from .ground import _ground_detectors
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to import these, they shouldn't have a _ prefix. The prefix is to indicate that the initial intention was only use within the module and through functions in that module. I would check if you really need to access this or if you can use a method of the Detector class directly.

from .space import *
from .space import _space_detectors
18 changes: 9 additions & 9 deletions pycbc/detector/ground.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def __init__(self, detector_name, reference_time=1126259462.0):
using a slower but higher precision method.
"""
self.name = str(detector_name)

lal_detectors = [pfx for pfx, name in get_available_lal_detectors()]
if detector_name in _ground_detectors:
self.info = _ground_detectors[detector_name]
Expand All @@ -247,6 +247,12 @@ def __init__(self, detector_name, reference_time=1126259462.0):
self.sday = None
self.gmst_reference = None

@property
def sky_coords(self):
""" List the sky coordinates used in response function.
"""
return 'ra', 'dec'

def set_gmst_reference(self):
if self.reference_time is not None:
self.sday = float(sday.si.scale)
Expand Down Expand Up @@ -477,7 +483,8 @@ def time_delay_from_detector(self, other_detector, right_ascension,

def project_wave(self, hp, hc, ra, dec, polarization,
method='lal',
reference_time=None):
reference_time=None,
**kwargs):
"""Return the strain of a waveform as measured by the detector.
Apply the time shift for the given detector relative to the assumed
geocentric frame and apply the antenna patterns to the plus and cross
Expand Down Expand Up @@ -663,10 +670,3 @@ def ppdets(ifos, separator=', '):
if ifos:
return separator.join(sorted(ifos))
return 'no detectors'

__all__ = ['Detector', 'get_available_detectors',
'get_available_lal_detectors',
'gmst_accurate', 'add_detector_on_earth',
'single_arm_frequency_response', 'ppdets',
'overhead_antenna_pattern', 'load_detector_config',
'_ground_detectors',]
Loading
Loading