Smooth.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2004 - 2016 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/General/Pulsar/Smooth.h
10 
11 #ifndef __Pulsar_Smooth_h
12 #define __Pulsar_Smooth_h
13 
14 #include "Pulsar/Transformation.h"
15 #include "TextInterface.h"
16 #include "PhaseRange.h"
17 
18 namespace Pulsar {
19 
20  class Profile;
21 
23  class Smooth : public Transformation<Profile>
24  {
25 
26  public:
27 
29  Smooth ();
30 
32  virtual ~Smooth ();
33 
35  virtual Smooth* clone () const = 0;
36 
38  virtual TextInterface::Parser* get_interface () = 0;
39 
41  class Interface;
42 
44  void set_width (const Phase::Value& w) { width = w; }
45 
47  Phase::Value get_width () const { return width; }
48 
50  void set_turns (float);
51 
53  float get_turns () const;
54 
56  void set_bins (float);
57 
59  float get_bins () const;
60 
62  static Smooth* factory (const std::string& name_and_options);
63 
64  protected:
65 
67  float get_bins (const Profile*);
68 
70  float get_turns (const Profile*);
71 
74  };
75 
77  class Smooth::Interface : public TextInterface::To<Smooth>
78  {
79  public:
80  Interface (Smooth* instance);
81  };
82 }
83 
84 #endif
double evaluate(std::vector< double > *grad=0) const
Application with basic command line options.
Definition: Application.h:30
void fit(const Pulsar::Parameters *model, std::vector< toa > &data, Pulsar::Parameters *postfit=NULL, bool track=false, Tempo::toa::State min_state=Tempo::toa::Normal)
Flux calibrator.
Definition: CalibratorTypes.h:34
const Calibrator::Type * get_type() const
Get the type of the calibrator.
Definition: CalibrationInterpolatorExtension.C:74
virtual Smooth * clone() const =0
Return a copy constructed instance of self.
Data storage implementations.
Definition: Container.h:24
Phase::Value width
The width of the smoothing.
Definition: Smooth.h:78
void set_width(const Phase::Value &w)
Set the width of the smoothing function.
Definition: Smooth.h:49
double evaluate(double)
void fit(std::vector< double > &data_x, std::vector< Estimate< double > > &data_y)
void set_bins(float)
Set the width of the smoothing window in phase bins.
Definition: Smooth.C:39
void set_smoothing(double)
Any quantity recorded as a function of pulse phase.
Definition: Profile.h:45
The primary interface to pulsar observational data.
Definition: Archive.h:45
Smooths a Profile using the mean over a boxcar.
Definition: SmoothMean.h:29
static Archive * load(const std::string &name)
Factory returns a new instance loaded from filename.
Definition: Archive_load.C:28
unsigned get_nbin() const
Return the number of bins.
Definition: ProfileAmps.h:50
Value get_Value(const Type &value)
const ScalarMath sqrt(const ScalarMath &x)
Stores the Stokes parameters of the reference source.
Definition: CalibratorStokes.h:28
Type * get() const
const ExtensionType * get() const
Template method searches for an Extension of the specified type.
void set_minimize_gcv(bool)
void set_value(const Type &value)
void fit(const std::vector< double > &data_x, const std::vector< Estimate< double > > &data_y)
Phase::Value get_width() const
Get the width of the smoothing function.
Definition: Smooth.h:52
Smooths a Profile by convolution with a sinc function.
Definition: SmoothSinc.h:28
Array of Profiles integrated over the same time interval.
Definition: Integration.h:37
Standard interpreter command line options.
Definition: StandardOptions.h:26
void set_turns(float)
Set the width of the smoothing window in turns.
Definition: Smooth.C:23
Stores PolnCalibrator parameters in an Archive instance.
Definition: PolnCalibratorExtension.h:28
A calibration solution that spans a finite bandwidth and time.
Definition: CalibrationInterpolator.h:32
void set_msre(double)
Determines the spline smoothing factor as in Clark (1977)
Definition: SplineSmooth.h:100
void set_effective_nfree(double)
virtual void add(Item *)
T get_value() const
virtual MJD get_epoch() const
Get the reference epoch of the calibration experiment.
Definition: CalibratorExtension.C:58
Profile smoothing algorithms.
Definition: Smooth.h:28
Flux Calibrator Extension.
Definition: FluxCalibratorExtension.h:28
virtual TextInterface::Parser * get_interface()=0
Return a text interface that can be used to configure this instance.
static Option< float > default_duty_cycle
fractional phase window used in most functions
Definition: Profile.h:62
float get_bins() const
Get the width of the smoothing window in phase bins.
Definition: Smooth.C:50
float get_turns() const
Get the width of the smoothing window in turns.
Definition: Smooth.C:33
std::string get_filename() const
Get the name of the file to which the archive will be unloaded.
Definition: Archive.h:108
bool has_scale() const
Returns true if scale and gain_ratio data are available.
Definition: FluxCalibratorExtension.h:89
static Smooth * factory(const std::string &name_and_options)
Construct a new Smooth instance from a string.
Definition: Smooth.C:88
Defines the PSRCHIVE library.
Definition: CalSource.h:17
Stores Polarization Calibration Model Interpolator information.
Definition: CalibrationInterpolatorExtension.h:29
U get_variance() const
virtual ~Smooth()
Destructor.
Definition: Smooth.C:18
void fit(std::vector< std::pair< double, double > > &data_x, std::vector< Estimate< double > > &data_y)
Fit spline to data using current configuration.
Definition: CrossValidatedSmooth2D.C:80
Smooth()
Default constructor.
Definition: Smooth.C:13
void set_has_covariance(bool)
Set if the covariances of the transformation parameters.
Definition: PolnCalibratorExtension.C:138
Smooths a Profile using the median over a boxcar.
Definition: SmoothMedian.h:29
unsigned get_nreceptor() const
Get the number of receptors.
Definition: FluxCalibratorExtension.C:90

Generated using doxygen 1.8.17