Skip to content

Commit

Permalink
Merge pull request #1655 from dlakaplan/pintkelongation
Browse files Browse the repository at this point in the history
Added elongation for `pintk`
  • Loading branch information
abhisrkckl authored Oct 23, 2023
2 parents 6880310 + 334fab7 commit a35fdfb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ the released changes.
- Piecewise orbital model (`BinaryBTPiecewise`)
- `TimingModel.fittable_params` property
- Simulate correlated noise using `pint.simulation` (also available via the `zima` script)
- `pintk` can plot against solar elongation
- Optionally return the the log normalization factor of the likelihood function from the `Residuals.calc_chi2()` method.
- `DownhilWLSFitter` can now estimate white noise parameters and their uncertainties.
- `Residuals.lnlikelihood()` method
Expand Down
7 changes: 7 additions & 0 deletions src/pint/pintk/plk.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"frequency": r"Observing Frequency (MHz)",
"TOA error": r"TOA uncertainty ($\mu$s)",
"rounded MJD": r"MJD",
"elongation": r"Solar Elongation (deg)",
}

helpstring = """The following interactions are currently supported in the plotting pane in `pintk`:
Expand Down Expand Up @@ -1228,6 +1229,12 @@ def psr_data_from_label(self, label):
elif label == "rounded MJD":
data = np.floor(self.psr.all_toas.get_mjds() + 0.5 * u.d)
error = self.psr.all_toas.get_errors().to(u.d)
elif label == "elongation":
data = np.degrees(
self.psr.prefit_model.sun_angle(self.psr.all_toas, also_distance=False)
)
error = None

return data, error

def coordToPoint(self, cx, cy):
Expand Down
1 change: 1 addition & 0 deletions src/pint/pintk/pulsar.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"frequency",
"TOA error",
"rounded MJD",
"elongation",
]

# Some parameters we do not want to add a fitting checkbox for:
Expand Down

0 comments on commit a35fdfb

Please sign in to comment.