From bb157dfe5fce9141c989c4d74a045d5506de1397 Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Wed, 12 Jan 2022 17:28:09 +0100 Subject: [PATCH] Add GPulsarEphemeris::pulse() methods --- include/GPulsarEphemeris.hpp | 35 +++++++++++++++++++++++++++++++---- pyext/GPulsarEphemeris.i | 2 ++ 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/include/GPulsarEphemeris.hpp b/include/GPulsarEphemeris.hpp index 8cec42e..19e4134 100644 --- a/include/GPulsarEphemeris.hpp +++ b/include/GPulsarEphemeris.hpp @@ -74,6 +74,8 @@ public: void tstop(const GTime& tstop); GTime t0(void) const; void t0(const GTime& t0); + double phase(void) const; + void phase(const double& phase); double f0(void) const; void f0(const double& f0); double f1(void) const; @@ -214,9 +216,9 @@ void GPulsarEphemeris::tstop(const GTime& tstop) /***********************************************************************//** - * @brief Returns time of phase 0 + * @brief Returns reference epoch of pulsar ephemeris * - * @return Reference time of phase 0. + * @return Reference epoch of pulsar ephemeris. ***************************************************************************/ inline GTime GPulsarEphemeris::t0(void) const @@ -226,9 +228,9 @@ GTime GPulsarEphemeris::t0(void) const /***********************************************************************//** - * @brief Set time of phase 0 + * @brief Set reference epoch of pulsar ephemeris * - * @param[in] t0 Reference time of phase 0. + * @param[in] t0 Reference epoch of pulsar ephemeris. ***************************************************************************/ inline void GPulsarEphemeris::t0(const GTime& t0) @@ -239,6 +241,31 @@ void GPulsarEphemeris::t0(const GTime& t0) /***********************************************************************//** + * @brief Returns pulse phase + * + * @return Pulse phase. + ***************************************************************************/ +inline +double GPulsarEphemeris::phase(void) const +{ + return (m_phase_curve.phase()); +} + + +/***********************************************************************//** + * @brief Set pulse phase + * + * @param[in] phase Pulse phase. + ***************************************************************************/ +inline +void GPulsarEphemeris::phase(const double& phase) +{ + m_phase_curve.phase(phase); + return; +} + + +/***********************************************************************//** * @brief Returns pulsar frequency (Hz) * * @return Pulsar frequency (Hz). diff --git a/pyext/GPulsarEphemeris.i b/pyext/GPulsarEphemeris.i index 4409d12..c00eefb 100644 --- a/pyext/GPulsarEphemeris.i +++ b/pyext/GPulsarEphemeris.i @@ -58,6 +58,8 @@ public: void tstop(const GTime& tstop); GTime t0(void) const; void t0(const GTime& t0); + double phase(void) const; + void phase(const double& phase); double f0(void) const; void f0(const double& f0); double f1(void) const; -- libgit2 0.21.4