Skip to content

Commit

Permalink
Merge branch 'nanograv:master' into tcb2tdb
Browse files Browse the repository at this point in the history
  • Loading branch information
abhisrkckl authored Feb 16, 2023
2 parents dd6622e + 5d23dc1 commit dc9b39e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ and this project, at least loosely, adheres to [Semantic Versioning](https://sem
- BIPM correction for simulated TOAs
- Added try/except to `test_pldmnoise.py`/`test_PLRedNoise_recovery` to avoid exceptions during CI
- Import for `longdouble2str` in `get_tempo_result`
- Plotting orbital phase in `pintk` when FB0 is used instead of PB
### Removed

## [0.9.3] 2022-12-16
Expand Down
10 changes: 9 additions & 1 deletion src/pint/models/timing_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,15 @@ def funct(t):
scs = []
for bt in bts:
# Make 11 times over one orbit after bt
ts = np.linspace(bt, bt + self.PB.value, 11)
if self.PB.value is not None:
pb = self.PB.value
elif self.FB0.quantity is not None:
pb = (1 / self.FB0.quantity).to("day").value
else:
raise AttributeError(
"Neither PB nor FB0 is present in the timing model."
)
ts = np.linspace(bt, bt + pb, 11)
# Compute the true anomalies and omegas for those times
nus = self.orbital_phase(ts, anom="true")
omegas = bbi.omega()
Expand Down
19 changes: 12 additions & 7 deletions src/pint/pintk/plk.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,7 @@ def __init__(self, master):
self.fitterSelect.bind("<<ComboboxSelected>>", self.changeFitter)

def updateFitterChoices(self, wideband):
if wideband:
self.fitterSelect["values"] = wb_fitters
else:
self.fitterSelect["values"] = nb_fitters
self.fitterSelect["values"] = wb_fitters if wideband else nb_fitters

def changeFitter(self, event):
self.fitter = self.fitterSelect.get() # get current value
Expand Down Expand Up @@ -438,7 +435,7 @@ def addColorModeCheckbox(self, colorModes):
model = self.master.psr.postfit_model
else:
model = self.master.psr.prefit_model
if not "PhaseJump" in model.components:
if "PhaseJump" not in model.components:
self.checkboxes[index].configure(state="disabled")

self.updateLayout()
Expand Down Expand Up @@ -670,7 +667,7 @@ class PlkWidget(tk.Frame):
def __init__(self, master=None, **kwargs):
tk.Frame.__init__(self, master)
self.configure(bg=background)
self.init_loglevel = kwargs["loglevel"] if "loglevel" in kwargs else None
self.init_loglevel = kwargs.get("loglevel")
self.initPlk()
self.initPlkLayout()
self.current_state = State()
Expand Down Expand Up @@ -1098,7 +1095,15 @@ def plotResiduals(self, keepAxes=False):
# Get the time of conjunction after T0 or TASC
tt = m.T0.value if hasattr(m, "T0") else m.TASC.value
mjd = m.conjunction(tt)
phs = (mjd - tt) * u.day / m.PB
if m.PB.value is not None:
pb = m.PB.value
elif m.FB0.quantity is not None:
pb = (1 / m.FB0.quantity).to("day").value
else:
raise AttributeError(
"Neither PB nor FB0 is present in the timing model."
)
phs = (mjd - tt) / pb
self.plkAxes.plot([phs, phs], [ymin, ymax], "k-")
else:
self.plkAxes.set_ylabel(plotlabels[self.yid])
Expand Down

0 comments on commit dc9b39e

Please sign in to comment.