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

Adding detector class for calculating LISA projections and response function #4691

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
50e8f56
Added LISA detector class with GPU support
acorreia61201 Apr 4, 2024
6a256d7
Fixed bug when calling get_tdi w/out setting t0
acorreia61201 Apr 4, 2024
6b6afde
Fixed sampling frequency bug in pyResponseTDI class initialization; f…
acorreia61201 Apr 29, 2024
7e9c2a4
TDI configuration now actually updates when providing tdi input in ge…
acorreia61201 May 31, 2024
5e072aa
Added reference_time to methods as kwarg; revised methods to be more …
acorreia61201 Jun 3, 2024
cb4f631
Revised init signature to be more similar to LIGO detector; rebase to…
acorreia61201 Jun 4, 2024
8333b88
Added polarization to project_wave signature; allow for shifting of o…
acorreia61201 Jun 6, 2024
0d8e32a
Add functionality to remove or zero edge data
acorreia61201 Jun 15, 2024
f74e76c
edited polarization rotation function; final touches for first draft
acorreia61201 Jul 11, 2024
72076ad
changed t0 to kwarg in init
acorreia61201 Jul 11, 2024
76fba8f
fix TypeError in unittest
acorreia61201 Jul 12, 2024
0dec06c
fix bug when calling ESAOrbits without lisatools
acorreia61201 Jul 12, 2024
67a131c
fix case where t0 is not None; remove debug statements/white space; e…
acorreia61201 Aug 30, 2024
9e282a5
Indentation fix in init
acorreia61201 Aug 30, 2024
820ef34
add padding (for signals that taper to zero); more cleanup
acorreia61201 Sep 3, 2024
3cd67d2
add controls for zero padding data to project_wave; add controls for …
acorreia61201 Sep 5, 2024
2a8a99f
remove orbit reference time; move TDI arguments to project_wave
acorreia61201 Sep 9, 2024
eb2696b
add time conversions (GPS time offset, SSB to LISA); moved more paddi…
acorreia61201 Sep 10, 2024
074a637
add debug statements, adjust SSB to LISA time conversions, fix sky co…
acorreia61201 Sep 16, 2024
40b1c2c
ref time accepts anything castable to float, tweak how TDI chans are …
Sep 16, 2024
a691a99
start reworking reference time to replicate bbhx (i.e. reference time…
Sep 17, 2024
0a00ad6
fix reference time to correctly calculate signal start time; fix samp…
acorreia61201 Sep 18, 2024
4791e21
fixes to start time calculation
acorreia61201 Sep 19, 2024
3285b96
set TDI chans to SSB times, clean up unnecessary attributes
acorreia61201 Sep 26, 2024
58b623a
rebase; update companion.txt to match master
acorreia61201 Oct 2, 2024
f2436e5
remove data if signal start time is before orbit start time (WIP)
acorreia61201 Oct 8, 2024
0ee5ac6
cut data if waveform extends outside of orbit file times; remove prin…
acorreia61201 Oct 17, 2024
734933c
add support for LDC software; rework space-based detector class such …
acorreia61201 Nov 6, 2024
c45aa61
rewrite LDC and FLR implementations as separate classes; rewrite spac…
acorreia61201 Nov 11, 2024
bfc0cc7
fixed import errors and removed print statements
acorreia61201 Nov 11, 2024
446d186
revert changes to companion
acorreia61201 Nov 14, 2024
70569b0
add flr warning message
acorreia61201 Nov 14, 2024
d63ae56
move common methods in base class to functions; move non-required att…
acorreia61201 Nov 15, 2024
7b042e7
restructured detector file into module; separated ground- and space-b…
acorreia61201 Nov 15, 2024
9e02bfb
Merge remote-tracking branch 'origin/master' into lisa-emri-pe
acorreia61201 Nov 15, 2024
28e37d4
add imports in detector init to get unittest working
acorreia61201 Nov 18, 2024
3589c23
make polarization optional in project_wave
acorreia61201 Nov 18, 2024
0eb2e7d
rerun checks
acorreia61201 Nov 18, 2024
8b40470
fix error when specifying orbits in space_detector
acorreia61201 Nov 18, 2024
7667a36
Merge branch 'master' into lisa-emri-pe
acorreia61201 Nov 18, 2024
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
3 changes: 3 additions & 0 deletions pycbc/detector/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .ground import *
from .ground import _ground_detectors
from .space import space_detector
132 changes: 1 addition & 131 deletions pycbc/detector.py → pycbc/detector/ground.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# =============================================================================
#
"""This module provides utilities for calculating detector responses and timing
between observatories.
between ground-based observatories.
"""
import os
import logging
Expand Down Expand Up @@ -655,136 +655,6 @@ def overhead_antenna_pattern(right_ascension, declination, polarization):
return f_plus, f_cross


""" LISA class """


class LISA(object):
"""For LISA detector
"""
def __init__(self):
None

def get_pos(self, ref_time):
"""Return the position of LISA detector for a given reference time
Parameters
----------
ref_time : numpy.ScalarType

Returns
-------
location : numpy.ndarray of shape (3,3)
Returns the position of all 3 sattelites with each row
correspoding to a single axis.
"""
ref_time = Time(val=ref_time, format='gps', scale='utc').jyear
n = np.array(range(1, 4))
kappa, _lambda_ = 0, 0
alpha = 2. * np.pi * ref_time/1 + kappa
beta_n = (n - 1) * 2.0 * pi / 3.0 + _lambda_
a, L = 1., 0.03342293561
e = L/(2. * a * np.sqrt(3))

x = a*cos(alpha) + a*e*(sin(alpha)*cos(alpha)*sin(beta_n) - (1 + sin(alpha)**2)*cos(beta_n))
y = a*sin(alpha) + a*e*(sin(alpha)*cos(alpha)*cos(beta_n) - (1 + cos(alpha)**2)*sin(beta_n))
z = -np.sqrt(3)*a*e*cos(alpha - beta_n)
self.location = np.array([x, y, z])

return self.location

def get_gcrs_pos(self, location):
""" Transforms ICRS frame to GCRS frame

Parameters
----------
loc : numpy.ndarray shape (3,1) units: AU
Cartesian Coordinates of the location
in ICRS frame

Returns
----------
loc : numpy.ndarray shape (3,1) units: meters
GCRS coordinates in cartesian system
"""
loc = location
loc = coordinates.SkyCoord(x=loc[0], y=loc[1], z=loc[2], unit=units.AU,
frame='icrs', representation_type='cartesian').transform_to('gcrs')
loc.representation_type = 'cartesian'
conv = np.float32(((loc.x.unit/units.m).decompose()).to_string())
loc = np.array([np.float32(loc.x), np.float32(loc.y),
np.float32(loc.z)])*conv
return loc

def time_delay_from_location(self, other_location, right_ascension,
declination, t_gps):
"""Return the time delay from the LISA detector to detector for
a signal with the given sky location. In other words return
`t1 - t2` where `t1` is the arrival time in this detector and
`t2` is the arrival time in the other location. Units(AU)

Parameters
----------
other_location : numpy.ndarray of coordinates in ICRS frame
A detector instance.
right_ascension : float
The right ascension (in rad) of the signal.
declination : float
The declination (in rad) of the signal.
t_gps : float
The GPS time (in s) of the signal.

Returns
-------
numpy.ndarray
The arrival time difference between the detectors.
"""
dx = self.location - other_location
cosd = cos(declination)
e0 = cosd * cos(right_ascension)
e1 = cosd * -sin(right_ascension)
e2 = sin(declination)
ehat = np.array([e0, e1, e2])
return dx.dot(ehat) / constants.c.value

def time_delay_from_detector(self, det, right_ascension,
declination, t_gps):
"""Return the time delay from the LISA detector for a signal with
the given sky location in ICRS frame; i.e. return `t1 - t2` where
`t1` is the arrival time in this detector and `t2` is the arrival
time in the other detector.

Parameters
----------
other_detector : detector.Detector
A detector instance.
right_ascension : float
The right ascension (in rad) of the signal.
declination : float
The declination (in rad) of the signal.
t_gps : float
The GPS time (in s) of the signal.

Returns
-------
numpy.ndarray
The arrival time difference between the detectors.
"""
loc = Detector(det, t_gps).get_icrs_pos()
return self.time_delay_from_location(loc, right_ascension,
declination, t_gps)

def time_delay_from_earth_center(self, right_ascension, declination, t_gps):
"""Return the time delay from the earth center in ICRS frame
"""
t_gps = Time(val=t_gps, format='gps', scale='utc')
earth = coordinates.get_body('earth', t_gps,
location=None).transform_to('icrs')
earth.representation_type = 'cartesian'
return self.time_delay_from_location(
np.array([np.float32(earth.x), np.float32(earth.y),
np.float32(earth.z)]), right_ascension,
declination, t_gps)


def ppdets(ifos, separator=', '):
"""Pretty-print a list (or set) of detectors: return a string listing
the given detectors alphabetically and separated by the given string
Expand Down
Loading
Loading