|
| ProfileShiftFit () |
| Default constructor.
|
| ~ProfileShiftFit () |
| Destructor.
|
void | reset () |
| Reset everything to zero, free internal memory.
|
void | set_nharm (unsigned nh) |
| Set the number of harmonics to use for fit.
|
unsigned | get_nharm () |
| Get the number of harmonics currently in use.
|
void | set_error_method (Error_Method e) |
| Set the error method.
|
void | set_mcmc_iterations (int nit) |
| Set number of iterations for MCMC errors.
|
int | get_mcmc_iterations () const |
| Get number of iterations.
|
void | set_standard (const Profile *p) |
| Set the standard or template profile to use.
|
void | set_Profile (const Profile *p) |
| Set the data profile to use.
|
void | compute () |
| Run the fit.
|
Tempo::toa | toa (const Integration *) |
| Return a TOA object for the current fit.
|
Estimate< double > | get_shift () |
| Get the resulting shift.
|
Estimate< double > | get_scale () |
| Get the resulting scale factor.
|
double | get_mse () |
| Get the resulting Mean Squared Error (per fit DOF)
|
double | get_sigma2 () |
| Get the resulting noise per harmonic.
|
double | get_snr () |
| Get the resulting SNR.
|
double | get_reduced_chisq () const |
| Get the reduced chi-squared.
|
double | get_effective_duty_cycle () const |
| Get the effective duty cycle of the standard.
|
void | apply_scale_and_shift (Profile *p) |
| Determine, then apply a shift a scale to data profile.
|
| Able (const Able &) |
Able & | operator= (const Able &) |
unsigned | get_reference_count () const |
| HeapTracked (const HeapTracked &) |
HeapTracked & | operator= (const HeapTracked &) |
bool | __is_on_heap () const |
|
void | init () |
| Initialize vars.
|
void | choose_nharm () |
| Choose the maximum number of harmonics using LastHarmonic.
|
double | ccf (double phi) |
| Evaluate ccf at phase shift phi.
|
double | dccf (double phi) |
| Evaluate d(ccf)/d(phi) at phase shift phi.
|
double | d2ccf (double phi) |
| Evaluate d^2(ccf)/d(phi)^2 at phase shift phi.
|
double | log_shift_pdf (double phi) |
| Returns log of a value proportional to the posterior shift PDF.
|
double | log_shift_pdf_pos (double phi) |
| Same as above, but with scale>0 prior.
|
void | error_traditional () |
| Calculate "traditional" parameter uncertainties.
|
void | error_numerical () |
| Calculate "traditional" parameter uncertainties.
|
void | error_mcmc_pdf_var () |
| Calculate shift uncertainty as posterior PDF variance using MCMC.
|
Handle * | __reference (bool active) const |
void | __dereference (bool auto_delete=true) const |
|
unsigned | nharm |
| Number of harmonics to use.
|
unsigned | effective_nharm |
| Effective number of harmonics = min (nharm, nbins_prof/2-1)
|
Reference::To< const Profile > | std |
| Current template profile.
|
unsigned | nbins_std |
| Current template nbin.
|
float * | fstd |
| R2C FFT of current template.
|
double | std_pow |
| Template normalization factor.
|
Reference::To< const Profile > | prof |
| Current data profile.
|
unsigned | nbins_prof |
| Number of bins in profile.
|
float * | fprof |
| R2C FFT of current profile.
|
float * | fccf |
| Current freq domain cross-correlation function.
|
unsigned | nbins_ccf |
| Number of bins in ccf.
|
Error_Method | err_meth |
| Error method to use.
|
int | mcmc_it |
| Number of iterations to use for MCMC.
|
bool | computed |
| Have valid results been computed.
|
double | shift |
| Current shift result.
|
double | eshift |
| Current shift error.
|
double | correction |
| Correction for profile nbins != template nbins.
|
double | scale |
| Current scale result.
|
double | escale |
| Current scale error.
|
double | sigma2 |
| Current sigma^2 estimate.
|
double | mse |
| Current fit MSE.
|
double | chi2 |
| Current fit Chi^2 (not reduced)
|
unsigned | dof |
| Current degrees of freedom.
|
double | snr |
| Current profile SNR.
|
Calculates profile shifts by fitting to a template/standard.
This class essentially reimplements the standard "Taylor fftfit" timing algorithm (used in PSRCHIVE's PhaseGradientShift method, etc). This has several benefits over the existing implementation in model_profile.C:
-
It caches the FFT'd template, resulting in about half as many FFT calls (when timing many profiles) versus the old routines.
-
It uses only the standard PSRCHIVE FFT interface, and avoids the old Fortran "fccf" routines.
-
The Chi2 minimization procedure is much more straightforward - at least in the author's opinion ;)
-
Additional information (fitted amplitude, profile sigma, etc) is returned in a cleaner, more extensible object oriented way.
-
Supports multiple/alternate phase shift error calculation algorithms.
double Pulsar::ProfileShiftFit::get_effective_duty_cycle |
( |
| ) |
const |
Get the effective duty cycle of the standard.
Refer to Equation 13 of van Straten (2006) or Equation B1 of Downs & Reichley (1983) [these equations are Fourier transform pairs]. The effective duty cycle is obtained when gain, g, and noise, sigma, both equal unity.
References fstd, Pulsar::ProfileStats::get_onpulse_nbin(), Pulsar::ProfileStats::get_total(), Estimate< typename T, typename U >::get_value(), nharm, and Pulsar::ProfileStats::set_profile().