FourierDomainFit.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2009 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/Timing/Pulsar/FourierDomainFit.h
10 
11 #ifndef __Pulsar_FourierDomainFit_h
12 #define __Pulsar_FourierDomainFit_h
13 
14 #include "Pulsar/ProfileStandardShift.h"
15 #include "Pulsar/ProfileShiftFit.h"
16 
17 namespace Pulsar {
18 
20  class FourierDomainFit : public ProfileStandardShift
21  {
22 
23  public:
24 
26 
28  void set_standard (const Profile* p);
29 
31  Estimate<double> get_shift () const;
32 
34  double get_reduced_chisq () const;
35 
37  double get_snr () const;
38 
41 
43  FourierDomainFit* clone () const { return new FourierDomainFit(*this); }
44 
46  void set_mcmc (bool flag = true) { error_method = flag ? "mcmc" : "trad"; }
47  bool get_mcmc () const { return error_method=="mcmc"; }
48 
50  void set_iterations (int nit) { fit.set_mcmc_iterations(nit); }
51  int get_iterations () const { return fit.get_mcmc_iterations(); }
52 
54  void set_error_method (std::string m) { error_method=m; }
55  std::string get_error_method () const { return error_method; }
56 
57  protected:
58 
59  class Interface;
60 
62  std::string error_method;
63 
65  mutable double reduced_chisq;
66 
68  mutable double snr;
69 
71  mutable ProfileShiftFit fit;
72 
73  };
74 
75 }
76 
77 
78 #endif // !defined __Pulsar_FourierDomainFit_h
double get_snr() const
Return the profile S/N ratio (relative to the standard)
Definition: FourierDomainFit.C:63
Estimate< double > get_shift() const
Return the shift estimate.
Definition: FourierDomainFit.C:27
void set_error_method(std::string m)
Set uncertainty calculation method.
Definition: FourierDomainFit.h:64
FourierDomainFit * clone() const
Return a copy constructed instance of self.
Definition: FourierDomainFit.h:53
double get_reduced_chisq() const
Return the statistical goodness-of-fit.
Definition: FourierDomainFit.C:57
double reduced_chisq
Reduced chisq of last call to get_shift.
Definition: FourierDomainFit.h:75
Any quantity recorded as a function of pulse phase.
Definition: Profile.h:45
void set_mcmc(bool flag=true)
Use Markov Chain Monte Carlo method to determine TOA uncertainty.
Definition: FourierDomainFit.h:56
std::string error_method
The uncertainty calculation method.
Definition: FourierDomainFit.h:69
ProfileShiftFit fit
The class that does the actual fit.
Definition: FourierDomainFit.h:81
int get_mcmc_iterations() const
Get number of iterations.
Definition: ProfileShiftFit.h:82
T get_value() const
double snr
S/N ratio of last profile fit.
Definition: FourierDomainFit.h:78
Calculates profile shifts by fitting to a template/standard.
Definition: ProfileShiftFit.h:48
void set_mcmc_iterations(int nit)
Set number of iterations for MCMC errors.
Definition: ProfileShiftFit.h:79
void set_iterations(int nit)
Set number of iterations for MCMC.
Definition: FourierDomainFit.h:60
Defines the PSRCHIVE library.
Definition: CalSource.h:17
void set_standard(const Profile *p)
Set the template profile.
Definition: FourierDomainFit.C:20
TextInterface::Parser * get_interface()
Return a text interface that can be used to configure this instance.
Definition: FourierDomainFit.C:100
Estimates phase shift in Fourier domain with MCMC error estimate *‍/.
Definition: FourierDomainFit.h:25

Generated using doxygen 1.8.17