Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dlakaplan committed Jan 17, 2024
1 parent 90391e2 commit ea9b1d0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pint/polycos.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class PolycoEntry:
Reference spin frequency
ncoeff : int
Number of coefficients
coeff : numpy.ndarray
coeffs : numpy.ndarray
Polynomial coefficents
"""

Expand Down Expand Up @@ -795,7 +795,6 @@ def generate_polycos(
rdcPhased = rdcPhase.astype(float)
rawcoeffs = np.polyfit(dtd, rdcPhased, ncoeff - 1)
coeffs = rawcoeffs[::-1]
rms = np.std(np.polyval(rawcoeffs, dtd) - rdcPhased)

date, hms = Time(tmid, format="mjd", scale="utc").iso.split()
yy, mm, dd = date.split("-")
Expand All @@ -815,6 +814,8 @@ def generate_polycos(
ncoeff,
coeffs,
)
ph_polyco = entry.evalabsphase(toas["tdbld"])
rms = np.std((ph_polyco - ph).frac)

entry_dict = OrderedDict()
entry_dict["psr"] = model.PSR.value
Expand All @@ -823,8 +824,7 @@ def generate_polycos(
entry_dict["tmid"] = tmid
entry_dict["dm"] = model.DM.value
entry_dict["doppler"] = doppler
# cap this to make it work format-wise
entry_dict["logrms"] = max(np.log10(rms), -9.9)
entry_dict["logrms"] = np.log10(rms)
entry_dict["mjd_span"] = segLength
entry_dict["t_start"] = entry.tstart
entry_dict["t_stop"] = entry.tstop
Expand Down

0 comments on commit ea9b1d0

Please sign in to comment.