Skip to content

Commit

Permalink
added spacecraft as alias for geocenter
Browse files Browse the repository at this point in the history
  • Loading branch information
dlakaplan committed Feb 21, 2024
1 parent fa790eb commit 73efb90
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG-unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ the released changes.
- Better exceptions for unsupported/unimplemented binary models (BTX, MSS, etc.)
- Emit warnings when `WaveX`/`DMWaveX` is used together with other representations of red/DM noise
- `get_observatory()` no longer overwrites `include_gps` and `include_bipm` of `Observatory` objects unless explicitly stated (BIPM and GPS clock corrections no longer incorrectly applied to BAT TOAs).
- Added back `spacecraft` as an alias for `stl_geo`
### Removed
3 changes: 2 additions & 1 deletion src/pint/observatory/special_locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
--------
:mod:`pint.observatory.topo_obs`
"""

import astropy.units as u
import numpy as np
from astropy.coordinates import EarthLocation
Expand Down Expand Up @@ -258,7 +259,7 @@ def load_special_locations():
# Need to initialize one of each so that it gets added to the list
BarycenterObs("barycenter", aliases=["@", "ssb", "bary", "bat"], overwrite=True)
GeocenterObs("geocenter", aliases=["0", "o", "coe", "geo"], overwrite=True)
T2SpacecraftObs("stl_geo", aliases=["STL_GEO"], overwrite=True)
T2SpacecraftObs("stl_geo", aliases=["STL_GEO", "spacecraft"], overwrite=True)
# TODO -- How to handle user changing bipm_version?


Expand Down
18 changes: 18 additions & 0 deletions tests/test_toa_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,24 @@ def test_toas_fermi_notoalist():
assert np.all(toas.table == toas2.table)


def test_geocenter():
toas = toa.get_TOAs(
io.StringIO(
"""pint 0.000000 57932.5446286608075925 4.321 stl_geo -format Tempo2 -creator nicer -mjdtt 57932.5454294 -tely -2783.63069101 -telx 6119.42973459 -telz -890.7794845 -nsrc 18.34 -obsid 70020101 -t NICER -vy 4.04867262 -vx 2.69970132 -dphi 0.20496 -nbkg 430.66 -vz 5.92980989 -exposure 1543.0
pint 0.000000 57933.6326461481560532 2.422 stl_geo -format Tempo2 -creator nicer -mjdtt 57933.6334469 -tely -4545.24145649 -telx 3799.22279181 -telz -3304.56529985 -nsrc 101.96 -obsid 70020102 -t NICER -vy 1.48403228 -vx 5.86477721 -dphi 0.20355 -nbkg 2394.04 -vz 4.70930058 -exposure 8100.71
"""
)
)
toas2 = toa.get_TOAs(
io.StringIO(
"""pint 0.000000 57932.5446286608075925 4.321 spacecraft -format Tempo2 -creator nicer -mjdtt 57932.5454294 -tely -2783.63069101 -telx 6119.42973459 -telz -890.7794845 -nsrc 18.34 -obsid 70020101 -t NICER -vy 4.04867262 -vx 2.69970132 -dphi 0.20496 -nbkg 430.66 -vz 5.92980989 -exposure 1543.0
pint 0.000000 57933.6326461481560532 2.422 spacecraft -format Tempo2 -creator nicer -mjdtt 57933.6334469 -tely -4545.24145649 -telx 3799.22279181 -telz -3304.56529985 -nsrc 101.96 -obsid 70020102 -t NICER -vy 1.48403228 -vx 5.86477721 -dphi 0.20355 -nbkg 2394.04 -vz 4.70930058 -exposure 8100.71
"""
)
)
assert np.all(toas == toas2)


def test_toa_wb():
t = pulsar_mjd.Time(np.array([55000, 56000]), scale="utc", format="pulsar_mjd")
obs = "gbt"
Expand Down

0 comments on commit 73efb90

Please sign in to comment.