Skip to content

Commit

Permalink
Remove no longer used include_gps parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
mhvk committed Feb 20, 2025
1 parent 65676f4 commit 7f53c61
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
6 changes: 1 addition & 5 deletions baseband_tasks/phases/pint_toas.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ class PintToas:
Flag to include the TT BIPM correction. Default is True.
bipm_version : str, optional
TT BIPM version. Default is 'BIPM2015'
include_gps : bool, optional
Flag to include the gps clock correction. Default is True.
planets : bool, optional
Flag to compute the planets' positions and velocities. Default is
False.
Expand All @@ -54,15 +52,13 @@ class PintToas:

def __init__(self, observatory, frequency, *,
ephemeris='jpl', include_bipm=True, bipm_version='BIPM2015',
include_gps=True, planets=False, tdb_method="default",
**kwargs):
planets=False, tdb_method="default", **kwargs):
self.observatory = observatory
self.frequency = frequency
self.control_params = {'ephem': ephemeris,
'bipm_version': bipm_version,
'include_bipm': include_bipm,
'bipm_version': bipm_version,
'include_gps': include_gps,
'planets': planets,
'tdb_method': tdb_method}
self.control_params.update(kwargs)
Expand Down
10 changes: 3 additions & 7 deletions baseband_tasks/tests/test_pint_toas.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,32 +50,28 @@ def test_time_input(self):
"Failed to initialize with default control parameters."
assert toas.clock_corr_info['bipm_version'] == 'BIPM2015', \
"Failed to initialize with default control parameters."
assert toas.clock_corr_info['include_gps'], \
"Failed to initialize with default control parameters."

def test_different_control_param(self):
# Test input control parameters from initializing;
# Here, we pick the astropy/erfa built-in ephemeris, to avoid
# downloading a(nother) big ephemeris file.
pt = pint_toas.PintToas(self.obs, self.freq, ephem='builtin',
include_bipm=False, include_gps=False)
include_bipm=False)
toas = pt(self.times)
assert toas.ephem == 'builtin', \
"Failed to initialize with input control parameters."
assert not toas.clock_corr_info['include_bipm'], \
"Failed to initialize with input control parameters."
assert not toas.clock_corr_info['include_gps'], \
"Failed to initialize with input control parameters."

def test_multiple_frequencies(self):
# Regression test for gh-95
freq = np.array([[1.4], [1.5]]) * u.GHz
pt = pint_toas.PintToas(self.obs, frequency=freq, ephem='builtin',
include_bipm=False, include_gps=False)
include_bipm=False)
toas = pt(self.times)
assert toas.shape == (2, 30)
freq = freq.squeeze()
pt2 = pint_toas.PintToas(self.obs, frequency=freq, ephem='builtin',
include_bipm=False, include_gps=False)
include_bipm=False)
toas2 = pt2(self.times[:, np.newaxis])
assert toas2.shape == (30, 2)

0 comments on commit 7f53c61

Please sign in to comment.