Commit 8e1420827d8a6ff95057875010c9ee13bb7529fe
1 parent
f0202fa8
Rename GPulsarEphemerides class to GPulsarEphemeris
Showing
12 changed files
with
185 additions
and
185 deletions
NEWS
| ... | ... | @@ -16,7 +16,7 @@ The following classes have been added: |
| 16 | 16 | - GIntegrals |
| 17 | 17 | - GResponseVectorCache |
| 18 | 18 | - GPulsar |
| 19 | -- GPulsarEphemerides | |
| 19 | +- GPulsarEphemeris | |
| 20 | 20 | - GSkyDirs |
| 21 | 21 | - GSkyRegionRect |
| 22 | 22 | - GModelAssociation |
| ... | ... | @@ -283,7 +283,7 @@ intervals (#3973). |
| 283 | 283 | Add GGti::reduce(GGti&) method to reduce Good Time Intervals to the intersection |
| 284 | 284 | with a specific list of intervals (#3973). |
| 285 | 285 | |
| 286 | -Add GPulsar and GPulsarEphemerides classes to support pulsar analysis (#3973). | |
| 286 | +Add GPulsar and GPulsarEphemeris classes to support pulsar analysis (#3973). | |
| 287 | 287 | |
| 288 | 288 | Add likelihood fit event selection hook (#3912). |
| 289 | 289 | ... | ... |
include/GPulsar.hpp
| ... | ... | @@ -31,7 +31,7 @@ |
| 31 | 31 | #include <string> |
| 32 | 32 | #include <vector> |
| 33 | 33 | #include "GBase.hpp" |
| 34 | -#include "GPulsarEphemerides.hpp" | |
| 34 | +#include "GPulsarEphemeris.hpp" | |
| 35 | 35 | |
| 36 | 36 | /* __ Forward declarations _______________________________________________ */ |
| 37 | 37 | class GGti; |
| ... | ... | @@ -66,14 +66,14 @@ public: |
| 66 | 66 | virtual std::string print(const GChatter& chatter = NORMAL) const; |
| 67 | 67 | |
| 68 | 68 | // Other methods |
| 69 | - int size(void) const; | |
| 70 | - bool is_empty(void) const; | |
| 71 | - const std::string& name(void) const; | |
| 72 | - void name(const std::string& name); | |
| 73 | - const GPulsarEphemerides& ephemerides(const GTime& time) const; | |
| 74 | - GGti validity(void) const; | |
| 75 | - void load(const GFilename& filename, | |
| 76 | - const std::string& name = ""); | |
| 69 | + int size(void) const; | |
| 70 | + bool is_empty(void) const; | |
| 71 | + const std::string& name(void) const; | |
| 72 | + void name(const std::string& name); | |
| 73 | + const GPulsarEphemeris& ephemeris(const GTime& time) const; | |
| 74 | + GGti validity(void) const; | |
| 75 | + void load(const GFilename& filename, | |
| 76 | + const std::string& name = ""); | |
| 77 | 77 | |
| 78 | 78 | protected: |
| 79 | 79 | // Protected methods |
| ... | ... | @@ -87,8 +87,8 @@ protected: |
| 87 | 87 | void load_parfile(const GFilename& filename); |
| 88 | 88 | |
| 89 | 89 | // Protected members |
| 90 | - std::string m_name; //!< Pulsar name | |
| 91 | - std::vector<GPulsarEphemerides> m_ephemerides; //!< Pulsar ephemerides | |
| 90 | + std::string m_name; //!< Pulsar name | |
| 91 | + std::vector<GPulsarEphemeris> m_ephemerides; //!< Pulsar ephemerides | |
| 92 | 92 | }; |
| 93 | 93 | |
| 94 | 94 | ... | ... |
include/GPulsarEphemerides.hpp renamed to include/GPulsarEphemeris.hpp
| 1 | 1 | /*************************************************************************** |
| 2 | - * GPulsarEphemerides.hpp - Pulsar ephemerides class * | |
| 2 | + * GPulsarEphemeris.hpp - Pulsar ephemeris class * | |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | 4 | * copyright (C) 2022 by Juergen Knoedlseder * |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| ... | ... | @@ -19,13 +19,13 @@ |
| 19 | 19 | * * |
| 20 | 20 | ***************************************************************************/ |
| 21 | 21 | /** |
| 22 | - * @file GPulsarEphemerides.hpp | |
| 23 | - * @brief Pulsar ephemerides class definition | |
| 22 | + * @file GPulsarEphemeris.hpp | |
| 23 | + * @brief Pulsar ephemeris class definition | |
| 24 | 24 | * @author Juergen Knoedlseder |
| 25 | 25 | */ |
| 26 | 26 | |
| 27 | -#ifndef GPULSAREPHEMERIDES_HPP | |
| 28 | -#define GPULSAREPHEMERIDES_HPP | |
| 27 | +#ifndef GPULSAREPHEMERIS_HPP | |
| 28 | +#define GPULSAREPHEMERIS_HPP | |
| 29 | 29 | |
| 30 | 30 | /* __ Includes ___________________________________________________________ */ |
| 31 | 31 | #include <string> |
| ... | ... | @@ -40,28 +40,28 @@ |
| 40 | 40 | |
| 41 | 41 | |
| 42 | 42 | /***********************************************************************//** |
| 43 | - * @class GPulsarEphemerides | |
| 43 | + * @class GPulsarEphemeris | |
| 44 | 44 | * |
| 45 | - * @brief Pulsar ephemerides class | |
| 45 | + * @brief Pulsar ephemeris class | |
| 46 | 46 | * |
| 47 | - * @todo Add class description. | |
| 47 | + * This class implements an ephemeris for a pulsar. | |
| 48 | 48 | ***************************************************************************/ |
| 49 | -class GPulsarEphemerides : public GBase { | |
| 49 | +class GPulsarEphemeris : public GBase { | |
| 50 | 50 | |
| 51 | 51 | public: |
| 52 | 52 | // Constructors and destructors |
| 53 | - GPulsarEphemerides(void); | |
| 54 | - GPulsarEphemerides(const GPulsarEphemerides& ephemerides); | |
| 55 | - virtual ~GPulsarEphemerides(void); | |
| 53 | + GPulsarEphemeris(void); | |
| 54 | + GPulsarEphemeris(const GPulsarEphemeris& ephemeris); | |
| 55 | + virtual ~GPulsarEphemeris(void); | |
| 56 | 56 | |
| 57 | 57 | // Operators |
| 58 | - GPulsarEphemerides& operator=(const GPulsarEphemerides& ephemerides); | |
| 58 | + GPulsarEphemeris& operator=(const GPulsarEphemeris& ephemeris); | |
| 59 | 59 | |
| 60 | 60 | // Implemented pure virtual base class methods |
| 61 | - virtual void clear(void); | |
| 62 | - virtual GPulsarEphemerides* clone(void) const; | |
| 63 | - virtual std::string classname(void) const; | |
| 64 | - virtual std::string print(const GChatter& chatter = NORMAL) const; | |
| 61 | + virtual void clear(void); | |
| 62 | + virtual GPulsarEphemeris* clone(void) const; | |
| 63 | + virtual std::string classname(void) const; | |
| 64 | + virtual std::string print(const GChatter& chatter = NORMAL) const; | |
| 65 | 65 | |
| 66 | 66 | // Other methods |
| 67 | 67 | const std::string& name(void) const; |
| ... | ... | @@ -85,7 +85,7 @@ public: |
| 85 | 85 | protected: |
| 86 | 86 | // Protected methods |
| 87 | 87 | void init_members(void); |
| 88 | - void copy_members(const GPulsarEphemerides& ephemerides); | |
| 88 | + void copy_members(const GPulsarEphemeris& ephemeris); | |
| 89 | 89 | void free_members(void); |
| 90 | 90 | |
| 91 | 91 | // Protected members |
| ... | ... | @@ -100,12 +100,12 @@ protected: |
| 100 | 100 | /***********************************************************************//** |
| 101 | 101 | * @brief Return class name |
| 102 | 102 | * |
| 103 | - * @return String containing the class name ("GPulsarEphemerides"). | |
| 103 | + * @return String containing the class name ("GPulsarEphemeris"). | |
| 104 | 104 | ***************************************************************************/ |
| 105 | 105 | inline |
| 106 | -std::string GPulsarEphemerides::classname(void) const | |
| 106 | +std::string GPulsarEphemeris::classname(void) const | |
| 107 | 107 | { |
| 108 | - return ("GPulsarEphemerides"); | |
| 108 | + return ("GPulsarEphemeris"); | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | |
| ... | ... | @@ -115,7 +115,7 @@ std::string GPulsarEphemerides::classname(void) const |
| 115 | 115 | * @return Pulsar name. |
| 116 | 116 | ***************************************************************************/ |
| 117 | 117 | inline |
| 118 | -const std::string& GPulsarEphemerides::name(void) const | |
| 118 | +const std::string& GPulsarEphemeris::name(void) const | |
| 119 | 119 | { |
| 120 | 120 | // Return |
| 121 | 121 | return m_name; |
| ... | ... | @@ -128,7 +128,7 @@ const std::string& GPulsarEphemerides::name(void) const |
| 128 | 128 | * @param[in] name Pulsar name. |
| 129 | 129 | ***************************************************************************/ |
| 130 | 130 | inline |
| 131 | -void GPulsarEphemerides::name(const std::string& name) | |
| 131 | +void GPulsarEphemeris::name(const std::string& name) | |
| 132 | 132 | { |
| 133 | 133 | m_name = name; |
| 134 | 134 | return; |
| ... | ... | @@ -141,7 +141,7 @@ void GPulsarEphemerides::name(const std::string& name) |
| 141 | 141 | * @return Pulsar sky direction. |
| 142 | 142 | ***************************************************************************/ |
| 143 | 143 | inline |
| 144 | -const GSkyDir& GPulsarEphemerides::dir(void) const | |
| 144 | +const GSkyDir& GPulsarEphemeris::dir(void) const | |
| 145 | 145 | { |
| 146 | 146 | // Return |
| 147 | 147 | return m_dir; |
| ... | ... | @@ -154,7 +154,7 @@ const GSkyDir& GPulsarEphemerides::dir(void) const |
| 154 | 154 | * @param[in] dir Pulsar sky direction. |
| 155 | 155 | ***************************************************************************/ |
| 156 | 156 | inline |
| 157 | -void GPulsarEphemerides::dir(const GSkyDir& dir) | |
| 157 | +void GPulsarEphemeris::dir(const GSkyDir& dir) | |
| 158 | 158 | { |
| 159 | 159 | m_dir = dir; |
| 160 | 160 | return; |
| ... | ... | @@ -167,7 +167,7 @@ void GPulsarEphemerides::dir(const GSkyDir& dir) |
| 167 | 167 | * @return Validity start time. |
| 168 | 168 | ***************************************************************************/ |
| 169 | 169 | inline |
| 170 | -const GTime& GPulsarEphemerides::tstart(void) const | |
| 170 | +const GTime& GPulsarEphemeris::tstart(void) const | |
| 171 | 171 | { |
| 172 | 172 | // Return |
| 173 | 173 | return m_tstart; |
| ... | ... | @@ -180,7 +180,7 @@ const GTime& GPulsarEphemerides::tstart(void) const |
| 180 | 180 | * @param[in] tstart Validity start time. |
| 181 | 181 | ***************************************************************************/ |
| 182 | 182 | inline |
| 183 | -void GPulsarEphemerides::tstart(const GTime& tstart) | |
| 183 | +void GPulsarEphemeris::tstart(const GTime& tstart) | |
| 184 | 184 | { |
| 185 | 185 | m_tstart = tstart; |
| 186 | 186 | return; |
| ... | ... | @@ -193,7 +193,7 @@ void GPulsarEphemerides::tstart(const GTime& tstart) |
| 193 | 193 | * @return Validity stop time. |
| 194 | 194 | ***************************************************************************/ |
| 195 | 195 | inline |
| 196 | -const GTime& GPulsarEphemerides::tstop(void) const | |
| 196 | +const GTime& GPulsarEphemeris::tstop(void) const | |
| 197 | 197 | { |
| 198 | 198 | // Return |
| 199 | 199 | return m_tstop; |
| ... | ... | @@ -206,7 +206,7 @@ const GTime& GPulsarEphemerides::tstop(void) const |
| 206 | 206 | * @param[in] tstop Validity stop time. |
| 207 | 207 | ***************************************************************************/ |
| 208 | 208 | inline |
| 209 | -void GPulsarEphemerides::tstop(const GTime& tstop) | |
| 209 | +void GPulsarEphemeris::tstop(const GTime& tstop) | |
| 210 | 210 | { |
| 211 | 211 | m_tstop = tstop; |
| 212 | 212 | return; |
| ... | ... | @@ -219,7 +219,7 @@ void GPulsarEphemerides::tstop(const GTime& tstop) |
| 219 | 219 | * @return Reference time of phase 0. |
| 220 | 220 | ***************************************************************************/ |
| 221 | 221 | inline |
| 222 | -GTime GPulsarEphemerides::t0(void) const | |
| 222 | +GTime GPulsarEphemeris::t0(void) const | |
| 223 | 223 | { |
| 224 | 224 | return (m_phase_curve.mjd()); |
| 225 | 225 | } |
| ... | ... | @@ -231,7 +231,7 @@ GTime GPulsarEphemerides::t0(void) const |
| 231 | 231 | * @param[in] t0 Reference time of phase 0. |
| 232 | 232 | ***************************************************************************/ |
| 233 | 233 | inline |
| 234 | -void GPulsarEphemerides::t0(const GTime& t0) | |
| 234 | +void GPulsarEphemeris::t0(const GTime& t0) | |
| 235 | 235 | { |
| 236 | 236 | m_phase_curve.mjd(t0); |
| 237 | 237 | return; |
| ... | ... | @@ -244,7 +244,7 @@ void GPulsarEphemerides::t0(const GTime& t0) |
| 244 | 244 | * @return Pulsar frequency (Hz). |
| 245 | 245 | ***************************************************************************/ |
| 246 | 246 | inline |
| 247 | -double GPulsarEphemerides::f0(void) const | |
| 247 | +double GPulsarEphemeris::f0(void) const | |
| 248 | 248 | { |
| 249 | 249 | return (m_phase_curve.f0()); |
| 250 | 250 | } |
| ... | ... | @@ -256,7 +256,7 @@ double GPulsarEphemerides::f0(void) const |
| 256 | 256 | * @param[in] f0 Pulsar frequency (Hz). |
| 257 | 257 | ***************************************************************************/ |
| 258 | 258 | inline |
| 259 | -void GPulsarEphemerides::f0(const double& f0) | |
| 259 | +void GPulsarEphemeris::f0(const double& f0) | |
| 260 | 260 | { |
| 261 | 261 | m_phase_curve.f0(f0); |
| 262 | 262 | return; |
| ... | ... | @@ -269,7 +269,7 @@ void GPulsarEphemerides::f0(const double& f0) |
| 269 | 269 | * @return Pulsar frequency derivative (s^-2). |
| 270 | 270 | ***************************************************************************/ |
| 271 | 271 | inline |
| 272 | -double GPulsarEphemerides::f1(void) const | |
| 272 | +double GPulsarEphemeris::f1(void) const | |
| 273 | 273 | { |
| 274 | 274 | return (m_phase_curve.f1()); |
| 275 | 275 | } |
| ... | ... | @@ -281,7 +281,7 @@ double GPulsarEphemerides::f1(void) const |
| 281 | 281 | * @param[in] f1 Pulsar frequency derivative (s^-2). |
| 282 | 282 | ***************************************************************************/ |
| 283 | 283 | inline |
| 284 | -void GPulsarEphemerides::f1(const double& f1) | |
| 284 | +void GPulsarEphemeris::f1(const double& f1) | |
| 285 | 285 | { |
| 286 | 286 | m_phase_curve.f1(f1); |
| 287 | 287 | return; |
| ... | ... | @@ -294,7 +294,7 @@ void GPulsarEphemerides::f1(const double& f1) |
| 294 | 294 | * @return Pulsar second frequency derivative (s^-3). |
| 295 | 295 | ***************************************************************************/ |
| 296 | 296 | inline |
| 297 | -double GPulsarEphemerides::f2(void) const | |
| 297 | +double GPulsarEphemeris::f2(void) const | |
| 298 | 298 | { |
| 299 | 299 | return (m_phase_curve.f2()); |
| 300 | 300 | } |
| ... | ... | @@ -306,7 +306,7 @@ double GPulsarEphemerides::f2(void) const |
| 306 | 306 | * @param[in] f2 Pulsar second frequency derivative (s^-3). |
| 307 | 307 | ***************************************************************************/ |
| 308 | 308 | inline |
| 309 | -void GPulsarEphemerides::f2(const double& f2) | |
| 309 | +void GPulsarEphemeris::f2(const double& f2) | |
| 310 | 310 | { |
| 311 | 311 | m_phase_curve.f2(f2); |
| 312 | 312 | return; |
| ... | ... | @@ -319,9 +319,9 @@ void GPulsarEphemerides::f2(const double& f2) |
| 319 | 319 | * @return Pulsar phase. |
| 320 | 320 | ***************************************************************************/ |
| 321 | 321 | inline |
| 322 | -double GPulsarEphemerides::phase(const GTime& time) const | |
| 322 | +double GPulsarEphemeris::phase(const GTime& time) const | |
| 323 | 323 | { |
| 324 | 324 | return (m_phase_curve.phase(time)); |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | -#endif /* GPULSAREPHEMERIDES_HPP */ | |
| 327 | +#endif /* GPULSAREPHEMERIS_HPP */ | ... | ... |
include/GammaLib.hpp
| ... | ... | @@ -198,7 +198,7 @@ |
| 198 | 198 | #include "GPhoton.hpp" |
| 199 | 199 | #include "GSource.hpp" |
| 200 | 200 | #include "GPulsar.hpp" |
| 201 | -#include "GPulsarEphemerides.hpp" | |
| 201 | +#include "GPulsarEphemeris.hpp" | |
| 202 | 202 | |
| 203 | 203 | /* __ Model handling _____________________________________________________ */ |
| 204 | 204 | #include "GModelPar.hpp" | ... | ... |
include/Makefile.am
inst/com/src/GCOMDri.cpp
| ... | ... | @@ -460,16 +460,16 @@ void GCOMDri::compute_dre(const GCOMObservation& obs, |
| 460 | 460 | // Optionally apply pulsar phase selection |
| 461 | 461 | if (has_pulsar) { |
| 462 | 462 | |
| 463 | - // Get pulsar ephemerides | |
| 464 | - const GPulsarEphemerides& ephemerides = | |
| 465 | - m_selection.pulsar().ephemerides(event->time()); | |
| 463 | + // Get pulsar ephemeris | |
| 464 | + const GPulsarEphemeris& ephemeris = | |
| 465 | + m_selection.pulsar().ephemeris(event->time()); | |
| 466 | 466 | |
| 467 | 467 | // Convert time to Solar System Barycentre |
| 468 | 468 | GTime time = event->time() + |
| 469 | - obs.bvcs().tdelta(ephemerides.dir(), event->time()); | |
| 469 | + obs.bvcs().tdelta(ephemeris.dir(), event->time()); | |
| 470 | 470 | |
| 471 | 471 | // Compute pulsar phase |
| 472 | - double phase = ephemerides.phase(time); | |
| 472 | + double phase = ephemeris.phase(time); | |
| 473 | 473 | |
| 474 | 474 | // If phase is not contained in phase interval then skip event |
| 475 | 475 | if (!m_selection.pulsar_phases().contains(phase)) { | ... | ... |
pyext/GPulsar.i
| ... | ... | @@ -49,14 +49,14 @@ public: |
| 49 | 49 | virtual std::string classname(void) const; |
| 50 | 50 | |
| 51 | 51 | // Other methods |
| 52 | - int size(void) const; | |
| 53 | - bool is_empty(void) const; | |
| 54 | - const std::string& name(void) const; | |
| 55 | - void name(const std::string& name); | |
| 56 | - const GPulsarEphemerides& ephemerides(const GTime& time) const; | |
| 57 | - GGti validity(void) const; | |
| 58 | - void load(const GFilename& filename, | |
| 59 | - const std::string& name = ""); | |
| 52 | + int size(void) const; | |
| 53 | + bool is_empty(void) const; | |
| 54 | + const std::string& name(void) const; | |
| 55 | + void name(const std::string& name); | |
| 56 | + const GPulsarEphemeris& ephemeris(const GTime& time) const; | |
| 57 | + GGti validity(void) const; | |
| 58 | + void load(const GFilename& filename, | |
| 59 | + const std::string& name = ""); | |
| 60 | 60 | }; |
| 61 | 61 | |
| 62 | 62 | ... | ... |
pyext/GPulsarEphemerides.i renamed to pyext/GPulsarEphemeris.i
| 1 | 1 | /*************************************************************************** |
| 2 | - * GPulsarEphemerides.i - Pulsar ephemerides class * | |
| 2 | + * GPulsarEphemeris.i - Pulsar ephemeris class * | |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | 4 | * copyright (C) 2022 by Juergen Knoedlseder * |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| ... | ... | @@ -19,33 +19,33 @@ |
| 19 | 19 | * * |
| 20 | 20 | ***************************************************************************/ |
| 21 | 21 | /** |
| 22 | - * @file GPulsarEphemerides.i | |
| 23 | - * @brief Pulsar ephemerides class definition | |
| 22 | + * @file GPulsarEphemeris.i | |
| 23 | + * @brief Pulsar ephemeris class definition | |
| 24 | 24 | * @author Juergen Knoedlseder |
| 25 | 25 | */ |
| 26 | 26 | %{ |
| 27 | 27 | /* Put headers and other declarations here that are needed for compilation */ |
| 28 | -#include "GPulsarEphemerides.hpp" | |
| 28 | +#include "GPulsarEphemeris.hpp" | |
| 29 | 29 | %} |
| 30 | 30 | |
| 31 | 31 | |
| 32 | 32 | /***********************************************************************//** |
| 33 | - * @class GPulsarEphemerides | |
| 33 | + * @class GPulsarEphemeris | |
| 34 | 34 | * |
| 35 | - * @brief Pulsar ephemerides class | |
| 35 | + * @brief Pulsar ephemeris class | |
| 36 | 36 | ***************************************************************************/ |
| 37 | -class GPulsarEphemerides : public GBase { | |
| 37 | +class GPulsarEphemeris : public GBase { | |
| 38 | 38 | |
| 39 | 39 | public: |
| 40 | 40 | // Constructors and destructors |
| 41 | - GPulsarEphemerides(void); | |
| 42 | - GPulsarEphemerides(const GPulsarEphemerides& ephemerides); | |
| 43 | - virtual ~GPulsarEphemerides(void); | |
| 41 | + GPulsarEphemeris(void); | |
| 42 | + GPulsarEphemeris(const GPulsarEphemeris& ephemeris); | |
| 43 | + virtual ~GPulsarEphemeris(void); | |
| 44 | 44 | |
| 45 | 45 | // Implemented pure virtual base class methods |
| 46 | - virtual void clear(void); | |
| 47 | - virtual GPulsarEphemerides* clone(void) const; | |
| 48 | - virtual std::string classname(void) const; | |
| 46 | + virtual void clear(void); | |
| 47 | + virtual GPulsarEphemeris* clone(void) const; | |
| 48 | + virtual std::string classname(void) const; | |
| 49 | 49 | |
| 50 | 50 | // Other methods |
| 51 | 51 | const std::string& name(void) const; |
| ... | ... | @@ -69,10 +69,10 @@ public: |
| 69 | 69 | |
| 70 | 70 | |
| 71 | 71 | /***********************************************************************//** |
| 72 | - * @brief GPulsarEphemerides class extension | |
| 72 | + * @brief GPulsarEphemeris class extension | |
| 73 | 73 | ***************************************************************************/ |
| 74 | -%extend GPulsarEphemerides { | |
| 75 | - GPulsarEphemerides copy() { | |
| 74 | +%extend GPulsarEphemeris { | |
| 75 | + GPulsarEphemeris copy() { | |
| 76 | 76 | return (*self); |
| 77 | 77 | } |
| 78 | 78 | }; | ... | ... |
pyext/gammalib/obs.i
src/obs/GPulsar.cpp
| ... | ... | @@ -189,17 +189,17 @@ GPulsar* GPulsar::clone(void) const |
| 189 | 189 | |
| 190 | 190 | |
| 191 | 191 | /***********************************************************************//** |
| 192 | - * @brief Return pulsar ephemerides | |
| 192 | + * @brief Return pulsar ephemeris | |
| 193 | 193 | * |
| 194 | 194 | * param[in] time Time. |
| 195 | - * @return Pulsar ephemerides. | |
| 195 | + * @return Pulsar ephemeris. | |
| 196 | 196 | * |
| 197 | 197 | * @exception GException::invalid_argument |
| 198 | - * No valid ephemerides found for specified @p time. | |
| 198 | + * No valid ephemeris found for specified @p time. | |
| 199 | 199 | * |
| 200 | - * Returns the pulsar ephemerides as function of time. | |
| 200 | + * Returns the pulsar ephemeris as function of time. | |
| 201 | 201 | ***************************************************************************/ |
| 202 | -const GPulsarEphemerides& GPulsar::ephemerides(const GTime& time) const | |
| 202 | +const GPulsarEphemeris& GPulsar::ephemeris(const GTime& time) const | |
| 203 | 203 | { |
| 204 | 204 | // Find appropriate ephemerides |
| 205 | 205 | int ifound = -1; |
| ... | ... | @@ -213,7 +213,7 @@ const GPulsarEphemerides& GPulsar::ephemerides(const GTime& time) const |
| 213 | 213 | |
| 214 | 214 | // Throw an expection if no valid ephemerides were found |
| 215 | 215 | if (ifound == -1) { |
| 216 | - std::string msg = "No valid ephemerides found for MJD "+ | |
| 216 | + std::string msg = "No valid ephemeris found for MJD "+ | |
| 217 | 217 | gammalib::str(time.mjd())+". Please specify " |
| 218 | 218 | "ephemerides that comprise the time."; |
| 219 | 219 | throw GException::invalid_argument(G_PHASE, msg); |
| ... | ... | @@ -519,21 +519,21 @@ void GPulsar::load_integral(const GFitsTable* table, const std::string& name) |
| 519 | 519 | t0.mjd(tref0->real(i)); |
| 520 | 520 | t0 += t2peak->real(i); |
| 521 | 521 | |
| 522 | - // Allocate ephemerides | |
| 523 | - GPulsarEphemerides ephemerides; | |
| 522 | + // Allocate ephemeris | |
| 523 | + GPulsarEphemeris ephemeris; | |
| 524 | 524 | |
| 525 | 525 | // Set attributes |
| 526 | - ephemerides.name(m_name); | |
| 527 | - ephemerides.dir(dir); | |
| 528 | - ephemerides.tstart(tstart); | |
| 529 | - ephemerides.tstop(tstop); | |
| 530 | - ephemerides.t0(t0); | |
| 531 | - ephemerides.f0(f0->real(i)); | |
| 532 | - ephemerides.f1(f1->real(i)); | |
| 533 | - ephemerides.f2(f2->real(i)); | |
| 534 | - | |
| 535 | - // Push back ephemerides | |
| 536 | - m_ephemerides.push_back(ephemerides); | |
| 526 | + ephemeris.name(m_name); | |
| 527 | + ephemeris.dir(dir); | |
| 528 | + ephemeris.tstart(tstart); | |
| 529 | + ephemeris.tstop(tstop); | |
| 530 | + ephemeris.t0(t0); | |
| 531 | + ephemeris.f0(f0->real(i)); | |
| 532 | + ephemeris.f1(f1->real(i)); | |
| 533 | + ephemeris.f2(f2->real(i)); | |
| 534 | + | |
| 535 | + // Push back ephemeris | |
| 536 | + m_ephemerides.push_back(ephemeris); | |
| 537 | 537 | |
| 538 | 538 | } // endfor: looped over ephemerides |
| 539 | 539 | |
| ... | ... | @@ -592,21 +592,21 @@ void GPulsar::load_fermi(const GFitsTable* table, const std::string& name) |
| 592 | 592 | GTime t0; |
| 593 | 593 | t0.mjd(toabary_int->integer(i)+toabary_frac->real(i)); |
| 594 | 594 | |
| 595 | - // Allocate ephemerides | |
| 596 | - GPulsarEphemerides ephemerides; | |
| 595 | + // Allocate ephemeris | |
| 596 | + GPulsarEphemeris ephemeris; | |
| 597 | 597 | |
| 598 | 598 | // Set attributes |
| 599 | - ephemerides.name(m_name); | |
| 600 | - ephemerides.dir(dir); | |
| 601 | - ephemerides.tstart(tstart); | |
| 602 | - ephemerides.tstop(tstop); | |
| 603 | - ephemerides.t0(t0); | |
| 604 | - ephemerides.f0(f0->real(i)); | |
| 605 | - ephemerides.f1(f1->real(i)); | |
| 606 | - ephemerides.f2(f2->real(i)); | |
| 607 | - | |
| 608 | - // Push back ephemerides | |
| 609 | - m_ephemerides.push_back(ephemerides); | |
| 599 | + ephemeris.name(m_name); | |
| 600 | + ephemeris.dir(dir); | |
| 601 | + ephemeris.tstart(tstart); | |
| 602 | + ephemeris.tstop(tstop); | |
| 603 | + ephemeris.t0(t0); | |
| 604 | + ephemeris.f0(f0->real(i)); | |
| 605 | + ephemeris.f1(f1->real(i)); | |
| 606 | + ephemeris.f2(f2->real(i)); | |
| 607 | + | |
| 608 | + // Push back ephemeris | |
| 609 | + m_ephemerides.push_back(ephemeris); | |
| 610 | 610 | |
| 611 | 611 | } // endfor: looped over ephemerides |
| 612 | 612 | |
| ... | ... | @@ -731,21 +731,21 @@ void GPulsar::load_psrtime(const GFilename& filename, const std::string& name) |
| 731 | 731 | GTime t0; |
| 732 | 732 | t0.mjd(t0geo); // TODO: conversion to Bary ??? |
| 733 | 733 | |
| 734 | - // Allocate ephemerides | |
| 735 | - GPulsarEphemerides ephemerides; | |
| 734 | + // Allocate ephemeris | |
| 735 | + GPulsarEphemeris ephemeris; | |
| 736 | 736 | |
| 737 | 737 | // Set attributes |
| 738 | - ephemerides.name(m_name); | |
| 739 | - ephemerides.dir(dir); | |
| 740 | - ephemerides.tstart(tstart); | |
| 741 | - ephemerides.tstop(tstop); | |
| 742 | - ephemerides.t0(t0); | |
| 743 | - ephemerides.f0(f0); | |
| 744 | - ephemerides.f1(f1); | |
| 745 | - ephemerides.f2(f2); | |
| 746 | - | |
| 747 | - // Push back ephemerides | |
| 748 | - m_ephemerides.push_back(ephemerides); | |
| 738 | + ephemeris.name(m_name); | |
| 739 | + ephemeris.dir(dir); | |
| 740 | + ephemeris.tstart(tstart); | |
| 741 | + ephemeris.tstop(tstop); | |
| 742 | + ephemeris.t0(t0); | |
| 743 | + ephemeris.f0(f0); | |
| 744 | + ephemeris.f1(f1); | |
| 745 | + ephemeris.f2(f2); | |
| 746 | + | |
| 747 | + // Push back ephemeris | |
| 748 | + m_ephemerides.push_back(ephemeris); | |
| 749 | 749 | |
| 750 | 750 | } // endwhile: looped over lines |
| 751 | 751 | |
| ... | ... | @@ -758,17 +758,17 @@ void GPulsar::load_psrtime(const GFilename& filename, const std::string& name) |
| 758 | 758 | |
| 759 | 759 | |
| 760 | 760 | /***********************************************************************//** |
| 761 | - * @brief Load Pulsar from ephemerides par file | |
| 761 | + * @brief Load Pulsar from ephemeris par file | |
| 762 | 762 | * |
| 763 | - * @param[in] filename Name of pulsar ephemerides par file | |
| 763 | + * @param[in] filename Name of pulsar ephemeris par file | |
| 764 | 764 | * @param[in] name Pulsar name |
| 765 | 765 | * |
| 766 | 766 | * @exception GException::file_error |
| 767 | - * Could not open ephemerides ASCII file | |
| 767 | + * Could not open ephemeris ASCII file | |
| 768 | 768 | * @exception GException::invalid_argument |
| 769 | 769 | * No valid Right Ascension and Declination found |
| 770 | 770 | * |
| 771 | - * Load a pulsar from an ephemerides par file. | |
| 771 | + * Load a pulsar from an ephemeris par file. | |
| 772 | 772 | ***************************************************************************/ |
| 773 | 773 | void GPulsar::load_parfile(const GFilename& filename) |
| 774 | 774 | { |
| ... | ... | @@ -779,16 +779,16 @@ void GPulsar::load_parfile(const GFilename& filename) |
| 779 | 779 | // Open file |
| 780 | 780 | FILE* fptr = std::fopen(filename.url().c_str(), "r"); |
| 781 | 781 | if (fptr == NULL) { |
| 782 | - std::string msg = "Pulsar ephemerides file \""+filename.url()+ | |
| 782 | + std::string msg = "Pulsar ephemeris file \""+filename.url()+ | |
| 783 | 783 | "\" not found or readable. Please specify a " |
| 784 | - "valid and readable ephemerides file."; | |
| 784 | + "valid and readable ephemeris file."; | |
| 785 | 785 | throw GException::file_error(G_LOAD_PARFILE, msg); |
| 786 | 786 | } |
| 787 | 787 | |
| 788 | - // Allocate ephemerides | |
| 789 | - GPulsarEphemerides ephemerides; | |
| 790 | - double ra = 9999.0; | |
| 791 | - double dec = 9999.0; | |
| 788 | + // Allocate ephemeris | |
| 789 | + GPulsarEphemeris ephemeris; | |
| 790 | + double ra = 9999.0; | |
| 791 | + double dec = 9999.0; | |
| 792 | 792 | |
| 793 | 793 | // Read lines |
| 794 | 794 | while (std::fgets(line, n, fptr) != NULL) { |
| ... | ... | @@ -799,7 +799,7 @@ void GPulsar::load_parfile(const GFilename& filename) |
| 799 | 799 | // Extract keywords |
| 800 | 800 | if (elements[0] == "PSRJ") { |
| 801 | 801 | m_name = "PSR " + gammalib::rstrip_chars(elements[1], "\n"); |
| 802 | - ephemerides.name(m_name); | |
| 802 | + ephemeris.name(m_name); | |
| 803 | 803 | } |
| 804 | 804 | else if (elements[0] == "RAJ") { |
| 805 | 805 | std::vector<std::string> ras = gammalib::split(elements[1], ":"); |
| ... | ... | @@ -819,44 +819,44 @@ void GPulsar::load_parfile(const GFilename& filename) |
| 819 | 819 | else if (elements[0] == "START") { |
| 820 | 820 | GTime tstart; |
| 821 | 821 | tstart.mjd(gammalib::todouble(elements[1])); |
| 822 | - ephemerides.tstart(tstart); | |
| 822 | + ephemeris.tstart(tstart); | |
| 823 | 823 | } |
| 824 | 824 | else if (elements[0] == "FINISH") { |
| 825 | 825 | GTime tstop; |
| 826 | 826 | tstop.mjd(gammalib::todouble(elements[1])); |
| 827 | - ephemerides.tstop(tstop); | |
| 827 | + ephemeris.tstop(tstop); | |
| 828 | 828 | } |
| 829 | 829 | else if (elements[0] == "TZRMJD") { // TODO: Are you sure??? |
| 830 | 830 | GTime t0; |
| 831 | 831 | t0.mjd(gammalib::todouble(elements[1])); |
| 832 | - ephemerides.t0(t0); | |
| 832 | + ephemeris.t0(t0); | |
| 833 | 833 | } |
| 834 | 834 | else if (elements[0] == "F0") { |
| 835 | - ephemerides.f0(gammalib::todouble(elements[1])); | |
| 835 | + ephemeris.f0(gammalib::todouble(elements[1])); | |
| 836 | 836 | } |
| 837 | 837 | else if (elements[0] == "F1") { |
| 838 | - ephemerides.f1(gammalib::todouble(elements[1])); | |
| 838 | + ephemeris.f1(gammalib::todouble(elements[1])); | |
| 839 | 839 | } |
| 840 | 840 | else if (elements[0] == "F2") { |
| 841 | - ephemerides.f2(gammalib::todouble(elements[1])); | |
| 841 | + ephemeris.f2(gammalib::todouble(elements[1])); | |
| 842 | 842 | } |
| 843 | 843 | |
| 844 | 844 | } // endwhile: looped over lines |
| 845 | 845 | |
| 846 | 846 | // If Right Ascension and Declination is valid then set sky direction |
| 847 | - // and push back ephemerides | |
| 847 | + // and push back ephemeris | |
| 848 | 848 | if (ra >= 0.0 && ra <= 360.0 && dec >= -90.0 && dec <= 90.0) { |
| 849 | 849 | GSkyDir dir; |
| 850 | 850 | dir.radec_deg(ra, dec); |
| 851 | - ephemerides.dir(dir); | |
| 852 | - m_ephemerides.push_back(ephemerides); | |
| 851 | + ephemeris.dir(dir); | |
| 852 | + m_ephemerides.push_back(ephemeris); | |
| 853 | 853 | } |
| 854 | 854 | |
| 855 | 855 | // ... otherwise throw an exception |
| 856 | 856 | else { |
| 857 | 857 | std::string msg = "No valid Right Ascension or Declination found in " |
| 858 | - "pulsar ephemerides file \""+filename.url()+"\". " | |
| 859 | - "Please verify the ephemerides file."; | |
| 858 | + "pulsar ephemeris file \""+filename.url()+"\". " | |
| 859 | + "Please verify the ephemeris file."; | |
| 860 | 860 | throw GException::invalid_argument(G_LOAD_PARFILE, msg); |
| 861 | 861 | } |
| 862 | 862 | ... | ... |
src/obs/GPulsarEphemerides.cpp renamed to src/obs/GPulsarEphemeris.cpp
| 1 | 1 | /*************************************************************************** |
| 2 | - * GPulsarEphemerides.cpp - Pulsar ephemerides class * | |
| 2 | + * GPulsarEphemeris.cpp - Pulsar ephemeris class * | |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | 4 | * copyright (C) 2022 by Juergen Knoedlseder * |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| ... | ... | @@ -19,8 +19,8 @@ |
| 19 | 19 | * * |
| 20 | 20 | ***************************************************************************/ |
| 21 | 21 | /** |
| 22 | - * @file GPulsarEphemerides.cpp | |
| 23 | - * @brief Pulsar ephemerides class implementation | |
| 22 | + * @file GPulsarEphemeris.cpp | |
| 23 | + * @brief Pulsar ephemeris class implementation | |
| 24 | 24 | * @author Juergen Knoedlseder |
| 25 | 25 | */ |
| 26 | 26 | |
| ... | ... | @@ -28,7 +28,7 @@ |
| 28 | 28 | #ifdef HAVE_CONFIG_H |
| 29 | 29 | #include <config.h> |
| 30 | 30 | #endif |
| 31 | -#include "GPulsarEphemerides.hpp" | |
| 31 | +#include "GPulsarEphemeris.hpp" | |
| 32 | 32 | |
| 33 | 33 | /* __ Method name definitions ____________________________________________ */ |
| 34 | 34 | |
| ... | ... | @@ -49,7 +49,7 @@ |
| 49 | 49 | /***********************************************************************//** |
| 50 | 50 | * @brief Void constructor |
| 51 | 51 | ***************************************************************************/ |
| 52 | -GPulsarEphemerides::GPulsarEphemerides(void) | |
| 52 | +GPulsarEphemeris::GPulsarEphemeris(void) | |
| 53 | 53 | { |
| 54 | 54 | // Initialise class members |
| 55 | 55 | init_members(); |
| ... | ... | @@ -62,15 +62,15 @@ GPulsarEphemerides::GPulsarEphemerides(void) |
| 62 | 62 | /***********************************************************************//** |
| 63 | 63 | * @brief Copy constructor |
| 64 | 64 | * |
| 65 | - * @param[in] ephemerides Pulsar ephemerides. | |
| 65 | + * @param[in] ephemeris Pulsar ephemeris. | |
| 66 | 66 | ***************************************************************************/ |
| 67 | -GPulsarEphemerides::GPulsarEphemerides(const GPulsarEphemerides& ephemerides) | |
| 67 | +GPulsarEphemeris::GPulsarEphemeris(const GPulsarEphemeris& ephemeris) | |
| 68 | 68 | { |
| 69 | 69 | // Initialise class members |
| 70 | 70 | init_members(); |
| 71 | 71 | |
| 72 | 72 | // Copy members |
| 73 | - copy_members(ephemerides); | |
| 73 | + copy_members(ephemeris); | |
| 74 | 74 | |
| 75 | 75 | // Return |
| 76 | 76 | return; |
| ... | ... | @@ -80,7 +80,7 @@ GPulsarEphemerides::GPulsarEphemerides(const GPulsarEphemerides& ephemerides) |
| 80 | 80 | /***********************************************************************//** |
| 81 | 81 | * @brief Destructor |
| 82 | 82 | ***************************************************************************/ |
| 83 | -GPulsarEphemerides::~GPulsarEphemerides(void) | |
| 83 | +GPulsarEphemeris::~GPulsarEphemeris(void) | |
| 84 | 84 | { |
| 85 | 85 | // Free members |
| 86 | 86 | free_members(); |
| ... | ... | @@ -99,13 +99,13 @@ GPulsarEphemerides::~GPulsarEphemerides(void) |
| 99 | 99 | /***********************************************************************//** |
| 100 | 100 | * @brief Assignment operator |
| 101 | 101 | * |
| 102 | - * @param[in] ephemerides Pulsar ephemerides. | |
| 103 | - * @return Pulsar ephemerides. | |
| 102 | + * @param[in] ephemeris Pulsar ephemeris. | |
| 103 | + * @return Pulsar ephemeris. | |
| 104 | 104 | ***************************************************************************/ |
| 105 | -GPulsarEphemerides& GPulsarEphemerides::operator=(const GPulsarEphemerides& ephemerides) | |
| 105 | +GPulsarEphemeris& GPulsarEphemeris::operator=(const GPulsarEphemeris& ephemeris) | |
| 106 | 106 | { |
| 107 | 107 | // Execute only if object is not identical |
| 108 | - if (this != &ephemerides) { | |
| 108 | + if (this != &ephemeris) { | |
| 109 | 109 | |
| 110 | 110 | // Free members |
| 111 | 111 | free_members(); |
| ... | ... | @@ -114,7 +114,7 @@ GPulsarEphemerides& GPulsarEphemerides::operator=(const GPulsarEphemerides& ephe |
| 114 | 114 | init_members(); |
| 115 | 115 | |
| 116 | 116 | // Copy members |
| 117 | - copy_members(ephemerides); | |
| 117 | + copy_members(ephemeris); | |
| 118 | 118 | |
| 119 | 119 | } // endif: object was not identical |
| 120 | 120 | |
| ... | ... | @@ -130,9 +130,9 @@ GPulsarEphemerides& GPulsarEphemerides::operator=(const GPulsarEphemerides& ephe |
| 130 | 130 | ==========================================================================*/ |
| 131 | 131 | |
| 132 | 132 | /***********************************************************************//** |
| 133 | - * @brief Clear Pulsar ephemerides | |
| 133 | + * @brief Clear Pulsar ephemeris | |
| 134 | 134 | ***************************************************************************/ |
| 135 | -void GPulsarEphemerides::clear(void) | |
| 135 | +void GPulsarEphemeris::clear(void) | |
| 136 | 136 | { |
| 137 | 137 | // Free members |
| 138 | 138 | free_members(); |
| ... | ... | @@ -146,23 +146,23 @@ void GPulsarEphemerides::clear(void) |
| 146 | 146 | |
| 147 | 147 | |
| 148 | 148 | /***********************************************************************//** |
| 149 | - * @brief Clone Pulsar ephemerides | |
| 149 | + * @brief Clone Pulsar ephemeris | |
| 150 | 150 | * |
| 151 | - * @return Pointer to deep copy of Pulsar ephemerides. | |
| 151 | + * @return Pointer to deep copy of Pulsar ephemeris. | |
| 152 | 152 | ***************************************************************************/ |
| 153 | -GPulsarEphemerides* GPulsarEphemerides::clone(void) const | |
| 153 | +GPulsarEphemeris* GPulsarEphemeris::clone(void) const | |
| 154 | 154 | { |
| 155 | - return new GPulsarEphemerides(*this); | |
| 155 | + return new GPulsarEphemeris(*this); | |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | |
| 159 | 159 | /***********************************************************************//** |
| 160 | - * @brief Print Pulsar ephemerides | |
| 160 | + * @brief Print Pulsar ephemeris | |
| 161 | 161 | * |
| 162 | 162 | * @param[in] chatter Chattiness. |
| 163 | - * @return String containing Pulsar ephemerides information. | |
| 163 | + * @return String containing Pulsar ephemeris information. | |
| 164 | 164 | ***************************************************************************/ |
| 165 | -std::string GPulsarEphemerides::print(const GChatter& chatter) const | |
| 165 | +std::string GPulsarEphemeris::print(const GChatter& chatter) const | |
| 166 | 166 | { |
| 167 | 167 | // Initialise result string |
| 168 | 168 | std::string result; |
| ... | ... | @@ -171,7 +171,7 @@ std::string GPulsarEphemerides::print(const GChatter& chatter) const |
| 171 | 171 | if (chatter != SILENT) { |
| 172 | 172 | |
| 173 | 173 | // Append header |
| 174 | - result.append("=== GPulsarEphemerides ==="); | |
| 174 | + result.append("=== GPulsarEphemeris ==="); | |
| 175 | 175 | |
| 176 | 176 | // Append pulsar name and direction |
| 177 | 177 | result.append("\n"+gammalib::parformat("Pulsar name")); |
| ... | ... | @@ -241,7 +241,7 @@ std::string GPulsarEphemerides::print(const GChatter& chatter) const |
| 241 | 241 | /***********************************************************************//** |
| 242 | 242 | * @brief Initialise class members |
| 243 | 243 | ***************************************************************************/ |
| 244 | -void GPulsarEphemerides::init_members(void) | |
| 244 | +void GPulsarEphemeris::init_members(void) | |
| 245 | 245 | { |
| 246 | 246 | // Initialise members |
| 247 | 247 | m_name.clear(); |
| ... | ... | @@ -267,16 +267,16 @@ void GPulsarEphemerides::init_members(void) |
| 267 | 267 | /***********************************************************************//** |
| 268 | 268 | * @brief Copy class members |
| 269 | 269 | * |
| 270 | - * @param[in] ephemerides Pulsar ephemerides. | |
| 270 | + * @param[in] ephemeris Pulsar ephemeris. | |
| 271 | 271 | ***************************************************************************/ |
| 272 | -void GPulsarEphemerides::copy_members(const GPulsarEphemerides& ephemerides) | |
| 272 | +void GPulsarEphemeris::copy_members(const GPulsarEphemeris& ephemeris) | |
| 273 | 273 | { |
| 274 | 274 | // Copy members |
| 275 | - m_name = ephemerides.m_name; | |
| 276 | - m_tstart = ephemerides.m_tstart; | |
| 277 | - m_tstop = ephemerides.m_tstop; | |
| 278 | - m_dir = ephemerides.m_dir; | |
| 279 | - m_phase_curve = ephemerides.m_phase_curve; | |
| 275 | + m_name = ephemeris.m_name; | |
| 276 | + m_tstart = ephemeris.m_tstart; | |
| 277 | + m_tstop = ephemeris.m_tstop; | |
| 278 | + m_dir = ephemeris.m_dir; | |
| 279 | + m_phase_curve = ephemeris.m_phase_curve; | |
| 280 | 280 | |
| 281 | 281 | // Return |
| 282 | 282 | return; |
| ... | ... | @@ -286,7 +286,7 @@ void GPulsarEphemerides::copy_members(const GPulsarEphemerides& ephemerides) |
| 286 | 286 | /***********************************************************************//** |
| 287 | 287 | * @brief Delete class members |
| 288 | 288 | ***************************************************************************/ |
| 289 | -void GPulsarEphemerides::free_members(void) | |
| 289 | +void GPulsarEphemeris::free_members(void) | |
| 290 | 290 | { |
| 291 | 291 | // Return |
| 292 | 292 | return; | ... | ... |