From 92ce67bb420f99e516846f4f1ad9fdbe46e47e1c Mon Sep 17 00:00:00 2001 From: David Kaplan Date: Thu, 19 Oct 2023 10:36:18 -0500 Subject: [PATCH] added elongation for pintk --- CHANGELOG-unreleased.md | 1 + src/pint/pintk/plk.py | 7 +++++++ src/pint/pintk/pulsar.py | 1 + 3 files changed, 9 insertions(+) diff --git a/CHANGELOG-unreleased.md b/CHANGELOG-unreleased.md index 8200caa75..5b20044c9 100644 --- a/CHANGELOG-unreleased.md +++ b/CHANGELOG-unreleased.md @@ -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 ### Fixed - Wave model `validate()` can correctly use PEPOCH to assign WAVEEPOCH parameter - Fixed RTD by specifying theme explicitly. diff --git a/src/pint/pintk/plk.py b/src/pint/pintk/plk.py index 3a32ad013..9b3e87e3b 100644 --- a/src/pint/pintk/plk.py +++ b/src/pint/pintk/plk.py @@ -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`: @@ -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): diff --git a/src/pint/pintk/pulsar.py b/src/pint/pintk/pulsar.py index aa938fe31..e5ebeff78 100644 --- a/src/pint/pintk/pulsar.py +++ b/src/pint/pintk/pulsar.py @@ -37,6 +37,7 @@ "frequency", "TOA error", "rounded MJD", + "elongation", ] # Some parameters we do not want to add a fitting checkbox for: