Skip to content

Commit

Permalink
Merge branch 'nanograv:master' into implicitpar
Browse files Browse the repository at this point in the history
  • Loading branch information
dlakaplan authored Jun 26, 2024
2 parents 4d6bece + e66d250 commit ac927e8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ the released changes.
- `pint.models.chromatic_model.Chromatic` as the base class for variable-index chromatic delays.
- `pint.models.chromatic_model.ChromaticCM` for a Taylor series representation of the variable-index chromatic delay.
- Whitened residuals (`white-res`) as a plotting axis in `pintk`
- `TOAs.get_Tspan()` method
### Fixed
- `pint.utils.split_swx()` to use updated `SolarWindDispersionX()` parameter naming convention
- Fix #1759 by changing order of comparison
Expand Down
6 changes: 3 additions & 3 deletions src/pint/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ def make_fake_toas(
name: str = "fake",
subtract_mean: bool = True,
) -> pint.toa.TOAs:
"""Make toas from an array of times
"""Make toas from an array of TOAs
Can include alternating frequencies if fed an array of frequencies,
only works with one observatory at a time
Uses the input TOAs as a starting place, but then adjusts to fit the given model
and then optionally adds noise.
Parameters
----------
Expand Down
6 changes: 5 additions & 1 deletion src/pint/toa.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ def get_TOAs_list(
)
else:
log.debug(
f"Not applying clock corrections since at least some TOAs already have clkcorr in their flags."
"Not applying clock corrections since at least some TOAs already have clkcorr in their flags."
)
if "tdb" not in t.table.colnames:
t.compute_TDBs(method=tdb_method, ephem=ephem)
Expand Down Expand Up @@ -1690,6 +1690,10 @@ def get_mjds(self, high_precision: bool = False) -> u.Quantity:
else:
return self.table["mjd_float"].quantity

def get_Tspan(self) -> u.Quantity:
mjds = self.get_mjds()
return mjds.max() - mjds.min()

def get_errors(self) -> u.Quantity:
"""Return a numpy array of the TOA errors in us."""
return self.table["error"].quantity
Expand Down
1 change: 1 addition & 0 deletions tests/test_toa.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def test_make_toas(self):
assert toas.table["error"].unit == u.us
assert toas.table["mjd"][0].precision == 9
assert toas.table["mjd"][0].location is not None
assert toas.get_Tspan() == toas.table["mjd"].max() - toas.table["mjd"].min()

def test_multiple_observatories_stay_attached(self):
obs1 = "gbt"
Expand Down

0 comments on commit ac927e8

Please sign in to comment.