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

add coordinates_space.py #4289

Merged
merged 144 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from 143 commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
06522ce
add coordinates_space.py
WuShichao Mar 13, 2023
a967fbb
add LISA/SSB frame params
WuShichao Mar 15, 2023
d31f211
add LISA_to_GEO and GEO_to_LISA
WuShichao Mar 15, 2023
3bbb0b1
add coordinates_space into FieldArray
WuShichao Mar 18, 2023
b1e3216
add doc and Astropy support
WuShichao Mar 18, 2023
27c26a9
update comments on sympy
WuShichao Mar 18, 2023
bd83c64
use fsolve from scipy instead
WuShichao Mar 19, 2023
bf07a1e
fix cc issues
WuShichao Mar 19, 2023
f1c21fb
fix cc issues
WuShichao Mar 19, 2023
e856f4b
minor fix
WuShichao Mar 19, 2023
e85bc51
update
WuShichao Mar 19, 2023
62fdd9f
Merge branch 'gwastro:master' into multiband_transform
WuShichao Mar 21, 2023
a1c8739
not use iteration
WuShichao Mar 22, 2023
542523d
Merge branch 'gwastro:master' into multiband_transform
WuShichao Mar 24, 2023
668ae7d
decouple LISA orbit and more accurate Earth
WuShichao Mar 27, 2023
cae4757
rename
WuShichao Mar 27, 2023
e3b5f84
remove jplephem
WuShichao Mar 27, 2023
0cddb9c
add the angular displacement of the Earth
WuShichao Mar 27, 2023
ced106d
use radians
WuShichao Mar 27, 2023
d67375f
make func readable in .ini
WuShichao Mar 28, 2023
5d9e72d
reverse back to master
WuShichao Mar 28, 2023
df18e9b
correct psi range
WuShichao Mar 29, 2023
c03d88c
reverse to master
WuShichao Mar 29, 2023
352073e
Merge branch 'multiband_transform' of https://github.com/WuShichao/py…
WuShichao Mar 29, 2023
52ec83b
fix unit issue in earth_position_SSB
WuShichao Apr 3, 2023
79bc677
put LISA to the "right" position
WuShichao Apr 4, 2023
6f1ebca
add LISA specific transform classes here
WuShichao Apr 5, 2023
ac4fc40
change names
WuShichao Apr 5, 2023
0b89641
update
WuShichao Apr 5, 2023
4f01ef2
make a package for coordinates
WuShichao Apr 6, 2023
cd10893
remove coordinates_space import
WuShichao Apr 6, 2023
b8e5625
move __all__ into __init__.py
WuShichao Apr 6, 2023
2615d02
remove all coordinates_space
WuShichao Apr 6, 2023
b432f0e
change TIME_OFFSET to seconds
WuShichao Apr 8, 2023
b434c09
fix SOBHB issue
WuShichao Apr 12, 2023
5f14830
rename
WuShichao Apr 17, 2023
0f85dc3
add SSB or LISA params into fid_params
WuShichao Apr 17, 2023
e00d1b6
rename
WuShichao Apr 17, 2023
7b2e5e4
fix cc issues
WuShichao Apr 17, 2023
ac74625
fix cc issue
WuShichao Apr 17, 2023
ad77581
fix cc issue
WuShichao Apr 17, 2023
b91ac58
update
WuShichao Apr 19, 2023
cf04a2e
update
WuShichao Apr 19, 2023
54073e4
fix
WuShichao Apr 19, 2023
9d859b5
add default names
WuShichao Apr 23, 2023
7910a95
overwrite params with same names
WuShichao Apr 23, 2023
d516d30
remove pre-fixed names
WuShichao Apr 23, 2023
9b57574
remove all pre-fixed names
WuShichao Apr 23, 2023
6c8cef3
not pop
WuShichao Apr 23, 2023
5669f07
fix inverse transform
WuShichao Apr 25, 2023
53b20ce
update tc
WuShichao Apr 26, 2023
3662303
not overwrite
WuShichao Apr 30, 2023
38d95f9
add SNR support for multi-model
WuShichao Apr 30, 2023
7166baa
Update waveform.py
WuShichao May 3, 2023
6c806f3
Merge branch 'gwastro:master' into multiband_transform
WuShichao May 3, 2023
cc0c2d9
t0 issue
WuShichao May 3, 2023
830b5c3
t0 issue
WuShichao May 3, 2023
bc24cd9
Update space.py
WuShichao May 7, 2023
2529d52
add obstime
WuShichao May 19, 2023
3a9322d
np.mod(psi_newframe, 2*np.pi)
WuShichao May 19, 2023
156dfd6
fix obstime
WuShichao May 21, 2023
1a38386
add support for array inputs
WuShichao Jun 4, 2023
e1b4ca4
Update hierarchical.py
WuShichao Jun 4, 2023
b38d47d
Merge branch 'gwastro:master' into multiband_transform
WuShichao Jun 4, 2023
2bfd901
just use Alex's implementation
WuShichao Jun 5, 2023
5372a32
CustomTransformMultiOutputs is in another PR, so remove it
WuShichao Jun 9, 2023
29215db
add LDC and LAL convention correction
WuShichao Jun 9, 2023
e2d389c
use pycbc standard names
WuShichao Jun 11, 2023
ad2e0a3
more meaningful name
WuShichao Jun 11, 2023
2b2e93a
use pycbc standard names
WuShichao Jun 11, 2023
2ce81bc
Update relbin.py
WuShichao Jun 11, 2023
eec4c1c
Merge branch 'gwastro:master' into multiband_transform
WuShichao Jun 11, 2023
cee4738
Update parameters.py
WuShichao Jun 11, 2023
fc04312
remove unnecessary changes
WuShichao Jun 11, 2023
e6f2674
fix cc issue
WuShichao Jun 11, 2023
9cda1f2
fix cc issue
WuShichao Jun 11, 2023
f4f8d32
fix cc issue
WuShichao Jun 11, 2023
1279666
fix cc issue
WuShichao Jun 11, 2023
ff2af5d
Merge branch 'gwastro:master' into multiband_transform
WuShichao Jun 12, 2023
b547483
compactify
WuShichao Jun 13, 2023
7ce1b9d
compactify
WuShichao Jun 13, 2023
c997389
add __all__ back
WuShichao Jun 13, 2023
f34b1d0
Update transforms.py
WuShichao Jun 13, 2023
db90980
Update transforms.py
WuShichao Jun 13, 2023
78b8ec3
Update test_transforms.py
WuShichao Jun 14, 2023
948e3ca
Update transforms.py
WuShichao Jun 14, 2023
7998cd2
update doc
WuShichao Jun 15, 2023
d39bf09
fix time warning
WuShichao Jun 15, 2023
199ce9d
Merge branch 'gwastro:master' into multiband_transform
WuShichao Jun 22, 2023
5acd874
Update space.py
WuShichao Jun 22, 2023
b45fdce
Update test_transforms.py
WuShichao Jun 22, 2023
f513dcc
Create test_coordinates_space.py
WuShichao Jun 22, 2023
9264796
fix cc issues
WuShichao Jun 23, 2023
2c001b6
fix cc issues
WuShichao Jun 23, 2023
6d3c503
fix cc issue
WuShichao Jun 23, 2023
450eebf
Update tox.ini
WuShichao Jun 23, 2023
0af7e89
Update tox.ini
WuShichao Jun 23, 2023
a6347b0
Update tox.ini
WuShichao Jun 23, 2023
44e7e21
Update tox.ini
WuShichao Jun 23, 2023
159b6c9
Update tox.ini
WuShichao Jun 25, 2023
9ee8c86
Update tox.ini
WuShichao Jun 25, 2023
5159f75
Update tox.ini
WuShichao Jun 25, 2023
7ddad33
Update test_coordinates_space.py
WuShichao Jun 26, 2023
cb8cd25
add inline doc
WuShichao Jun 26, 2023
4aaef29
Update tox.ini
WuShichao Jun 26, 2023
5e3aa85
add check of bbhx
WuShichao Jun 27, 2023
8ed9575
Update test_coordinates_space.py
WuShichao Jun 27, 2023
61d61ed
Update tox.ini
WuShichao Jun 27, 2023
d81314e
Merge branch 'gwastro:master' into multiband_transform
WuShichao Jul 4, 2023
fbf8fbd
Update test_coordinates_space.py
WuShichao Jul 4, 2023
d1fe3c8
Merge branch 'gwastro:master' into multiband_transform
WuShichao Jul 5, 2023
9629250
Merge branch 'gwastro:master' into multiband_transform
WuShichao Jul 10, 2023
3de4b35
Merge branch 'gwastro:master' into multiband_transform
WuShichao Aug 2, 2023
3d9dba7
add MultibandRelativeTimeDom into hierarchical.py
WuShichao Aug 2, 2023
b6c27f6
Update __init__.py
WuShichao Aug 3, 2023
37029ca
Update hierarchical.py
WuShichao Aug 3, 2023
6721aff
Merge branch 'gwastro:master' into multiband_transform
WuShichao Aug 7, 2023
635c3ee
Update hierarchical.py
WuShichao Aug 7, 2023
39f4a1d
Merge branch 'gwastro:master' into multiband_transform
WuShichao Aug 17, 2023
b24a047
Update relbin.py
WuShichao Aug 17, 2023
395039d
Update hierarchical.py
WuShichao Aug 17, 2023
e176430
Update hierarchical.py
WuShichao Aug 20, 2023
e3c793e
Update relbin.py
WuShichao Aug 24, 2023
7423058
Update hierarchical.py
WuShichao Aug 24, 2023
fef5a3f
Update hierarchical.py
WuShichao Aug 28, 2023
2e78ba8
Update hierarchical.py
WuShichao Aug 28, 2023
116e5bc
Update hierarchical.py
WuShichao Aug 28, 2023
cb5a9c4
Update hierarchical.py
WuShichao Aug 31, 2023
d13dca2
Update relbin.py
WuShichao Aug 31, 2023
b79d265
Update hierarchical.py
WuShichao Aug 31, 2023
7de0de5
Update hierarchical.py
WuShichao Sep 27, 2023
5418546
Update relbin.py
WuShichao Sep 27, 2023
1f9cf7d
Update __init__.py
WuShichao Sep 27, 2023
b22eb7e
Merge branch 'gwastro:master' into multiband_transform
WuShichao Oct 12, 2023
c673186
Update space.py
WuShichao Oct 12, 2023
2fa62c0
Update space.py
WuShichao Oct 12, 2023
c60008f
Update space.py
WuShichao Oct 12, 2023
5eb784a
fix psi issue
WuShichao Oct 12, 2023
7753d85
Merge branch 'gwastro:master' into multiband_transform
WuShichao Oct 13, 2023
a6718ca
Update test_coordinates_space.py
WuShichao Oct 13, 2023
df1619e
Update test_coordinates_space.py
WuShichao Oct 13, 2023
670f9de
Merge branch 'gwastro:master' into multiband_transform
WuShichao Oct 13, 2023
e39902b
Merge branch 'gwastro:master' into multiband_transform
WuShichao Oct 25, 2023
f8cb244
Merge branch 'gwastro:master' into multiband_transform
WuShichao Oct 30, 2023
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
37 changes: 37 additions & 0 deletions pycbc/coordinates/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright (C) 2023 Shichao Wu, Alex Nitz
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
"""
This modules provides functions for base coordinate transformations, and
more advanced transformations between ground-based detectors and space-borne
detectors.
"""

from pycbc.coordinates.base import *
from pycbc.coordinates.space import *


__all__ = ['cartesian_to_spherical_rho', 'cartesian_to_spherical_azimuthal',
'cartesian_to_spherical_polar', 'cartesian_to_spherical',
'spherical_to_cartesian',
'TIME_OFFSET_20_DEGREES',
'localization_to_propagation_vector',
'propagation_vector_to_localization', 'polarization_newframe',
't_lisa_from_ssb', 't_ssb_from_t_lisa',
'ssb_to_lisa', 'lisa_to_ssb',
'rotation_matrix_ssb_to_lisa', 'rotation_matrix_ssb_to_geo',
'lisa_position_ssb', 'earth_position_ssb',
't_geo_from_ssb', 't_ssb_from_t_geo', 'ssb_to_geo', 'geo_to_ssb',
'lisa_to_geo', 'geo_to_lisa',
]
17 changes: 15 additions & 2 deletions pycbc/coordinates.py → pycbc/coordinates/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,18 @@
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
""" Coordinate transformations.


#
# =============================================================================
#
# Preamble
#
# =============================================================================
#
"""
Base coordinate transformations, this module provides transformations between
cartesian and spherical coordinates.
"""
import numpy

Expand Down Expand Up @@ -60,6 +71,7 @@ def cartesian_to_spherical_azimuthal(x, y):
phi = numpy.arctan2(y, x)
return phi % (2 * numpy.pi)


def cartesian_to_spherical_polar(x, y, z):
""" Calculates the polar angle in spherical coordinates from Cartesian
coordinates. The polar angle is in [0,pi].
Expand Down Expand Up @@ -141,7 +153,8 @@ def spherical_to_cartesian(rho, phi, theta):
z = rho * numpy.cos(theta)
return x, y, z

Copy link
Member

Choose a reason for hiding this comment

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

Don't remove this. It should explicitly say what should be imported by * which is what all does. Your module should also use this feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ahnitz Will this be duplicated? Because __init__.py has __all__ already.


__all__ = ['cartesian_to_spherical_rho', 'cartesian_to_spherical_azimuthal',
'cartesian_to_spherical_polar', 'cartesian_to_spherical',
'spherical_to_cartesian',
]
]
Loading
Loading