Pulsar.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2005 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/Base/Classes/Pulsar/Pulsar.h
10 
11 #ifndef __Pulsar_Pulsar_h
12 #define __Pulsar_Pulsar_h
13 
14 #include "Warning.h"
15 
17 namespace Pulsar {
18 
20  extern bool range_checking_enabled;
21 
23  extern Warning warning;
24 
25 }
26 
27 #endif
void bscrunch(Container *, const ScrunchFactor &)
Integrate phase bins.
Definition: ScrunchFactor.h:116
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)
bool range_checking_enabled
Container classes should check array indeces at the cost of performance.
Definition: Pulsar.C:10
Smooth * get_smooth() const
Get the smoothing function.
Definition: BaselineWindow.C:77
bool as_Estimate
Output values using Estimate operator <<.
Definition: General/Pulsar/SimPolnTiming.h:127
float get_snr(const Profile *profile)
Return the signal to noise ratio based on the shift.
Definition: StandardSNR.C:17
virtual unsigned get_npol() const =0
Get the number of polarizations.
void set_choose_maximum_harmonic(bool flag=true)
Allow software to choose the maximum harmonic.
Definition: MatrixTemplateMatching.C:35
Warning warning
Warning messages filter.
Definition: Pulsar.C:12
virtual double get_centre_frequency(unsigned ichan) const
Get the centre frequency of the specified channel.
Definition: CalibratorExtension.C:101
void covariance(Scalar *function, unsigned index, std::vector< unsigned > &imap, std::vector< std::vector< double > > &covar)
void phase(Profile *input)
Compute the phase of the input complex-valued Profile.
Definition: Fourier.C:135
void extrapolate_benefit(unsigned steps)
Account for noise in the standard profile.
Definition: SimPolnTiming.C:410
Range boost_vector
Number of steps when varying the parallactic angle.
Definition: General/Pulsar/SimPolnTiming.h:115
Estimates phase shift in Fourier domain using matrix template matching.
Definition: MatrixTemplateMatching.h:26
Data storage implementations.
Definition: Container.h:24
void convert_state(Signal::State state)
Convert data to the specified state.
Definition: Archive_convert_state.C:14
virtual void add_script(const std::string &job)
Load a script into the jobs.
Definition: StandardOptions.C:39
virtual void resize(unsigned nsubint, unsigned npol=0, unsigned nchan=0, unsigned nbin=0)
Resize the Integration vector with new_Integration instances.
Definition: Archive_resize.C:26
Range width
Number of steps when varying the Gaussian width.
Definition: General/Pulsar/SimPolnTiming.h:103
Plots images of something as a function of pulse phase vs something.
Definition: PhaseVsTime.h:26
Base class of all plotters.
Definition: PlotLoop.h:28
void offset(double offset)
offsets each bin of the profile by offset
Definition: Profile.C:301
static ProfileWeightFunction * factory(const std::string &name_and_parse)
Construct a new ProfileWeightFunction from a string.
Definition: ProfileWeightFunction.C:79
void remove_baseline()
Remove the baseline from all profiles.
Definition: Archive_remove_baseline.C:17
void tscrunch(Container *, const ScrunchFactor &)
Integrate sub-integrations.
Definition: ScrunchFactor.h:109
Expert * expert()
Provide access to the expert interface.
Definition: Integration.C:162
void set_baseline_extent(float width)
Set the fractional number of high frequencies used to calculate noise.
Definition: FourierSNR.C:21
Simulates a simple Gaussian with a standard RVM and zero circular.
Definition: SimplePolnProfile.h:26
const float * get_amps() const
Return a pointer to the amplitudes array.
Definition: ProfileAmps.C:141
Range parallactic
Number of steps when varying the parallactic angle.
Definition: General/Pulsar/SimPolnTiming.h:111
float rvm_beta
Difference between magnetic axis and line of sight.
Definition: General/Pulsar/SimPolnTiming.h:81
void set_orientation(unsigned ireceptor, const Estimate< double > &theta)
Set the orientation, , of the specified receptor (radians)
Definition: Feed.C:165
static ShiftEstimator * factory(const std::string &name_and_parse)
Construct a new ShiftEstimator from a string.
Definition: ShiftEstimator.C:26
virtual void set_help_footer(const std::string &s)
bool choose_maximum_harmonic
Set true when set_standard should choose the maximum harmonic.
Definition: PolnProfileFit.h:162
Plot command line options.
Definition: PlotOptions.h:26
void set_noise(float)
Set the standard deviation of the noise.
Definition: SyntheticPolnProfile.C:55
static bool verbose
flag controls the amount output to stderr by Integration methods
Definition: Integration.h:42
const ScalarMath atan(const ScalarMath &x)
double obsfreq
Observed Frequency.
Definition: FITSHdrExtension.h:223
double get_centre_frequency(unsigned ichan) const
Get the Profile centre frequency attribute of the given channel.
Definition: Integration.C:359
virtual Interpreter * get_interpreter()
Provide access to the interpreter.
Definition: StandardOptions.C:79
virtual void configure(const std::string &)
Process a configuration command.
Definition: Plot.C:29
void transform(const Jones< float > &response)
Perform the congruence transformation on each polarimetric profile.
Definition: IntegrationExpert.h:110
void add_coordinate(double x, const Estimate< T, U > &d)
bool allow_infinite_frequency
allow dedispersion or Faraday rotation correction to infinite frequency
Definition: Interpreter.h:230
virtual unsigned get_nsubint() const =0
Get the number of sub-integrations stored in the file.
static SNRatioEstimator * factory(const std::string &name_and_parse)
Construct a new SNRatioEstimator from a string.
Definition: SNRatioEstimator.C:22
Stores a weight for each Profile phase bin.
Definition: PhaseWeight.h:29
const ScalarMath log(const ScalarMath &x)
std::ostream * output
Output stream.
Definition: General/Pulsar/SimPolnTiming.h:130
Profile smoothing (more accurately denoising) that uses a thresholded wavelet transform.
Definition: WaveletSmooth.h:26
float snr() const
Returns the signal to noise ratio of the profile.
Definition: Profile_snr.C:15
virtual unsigned get_nchan() const
Get the number of frequency channels.
Definition: CalibratorExtension.C:83
Estimate< T, U > get_slope() const
Any quantity recorded as a function of pulse phase.
Definition: Profile.h:45
float standard_noise
Relative noise in standard profile.
Definition: General/Pulsar/SimPolnTiming.h:78
Plots off-pulse mean or variance as a func of time and freq.
Definition: DynamicBaselineSpectrumPlot.h:23
The primary interface to pulsar observational data.
Definition: Archive.h:45
Smooths a Profile using the mean over a boxcar.
Definition: SmoothMean.h:29
double sumsq(int bin_start=0, int bin_end=0) const
Returns the sum of all amplitudes squared.
Definition: Profile.C:722
static Archive * load(const std::string &name)
Factory returns a new instance loaded from filename.
Definition: Archive_load.C:28
Corrects dispersive delays.
Definition: Dispersion.h:33
void set_reference_frequency(double MHz)
Set the reference frequency in MHz.
Definition: ColdPlasma.h:203
static void set_verbosity(unsigned level)
Set the verbosity level (0 to 3)
Definition: Archive_verbose.C:19
unsigned get_nbin() const
Return the number of bins.
Definition: ProfileAmps.h:50
void just_do_it(Archive *)
Just do the correction (off the books)
Definition: ColdPlasma.h:194
void scale(double scale)
multiplies each bin of the profile by scale
Definition: Profile.C:311
float offset
Phase offset of simulated observations.
Definition: General/Pulsar/SimPolnTiming.h:93
static bool verbose
flag controls the amount output to stderr by Profile methods
Definition: Profile.h:53
Phenomenological description of the receiver feed.
Definition: Feed.h:32
Reference::To< ScalarParameter > magnetic_axis
const ScalarMath sqrt(const ScalarMath &x)
void set_swims(float)
Set the peak standard deviation of the simulated SWIMS/jitter noise.
Definition: SyntheticPolnProfile.C:65
Stores the Stokes parameters of the reference source.
Definition: CalibratorStokes.h:28
const Profile * new_Profile(const PolnProfile *data, char code)
Return a possibly newly constructed Profile with state specified by code.
Definition: Polarization.C:35
Stores PSRFITS header extensions.
Definition: FITSHdrExtension.h:25
Type * get() const
unsigned iterations
Number of simulated observations for each step in simulation.
Definition: General/Pulsar/SimPolnTiming.h:87
Estimates phase shift in Fourier domain.
Definition: PhaseGradShift.h:27
void fscrunch(Container *, const ScrunchFactor &)
Integrate frequency channels.
Definition: ScrunchFactor.h:102
virtual void add_job(const std::string &job)
Add to the jobs.
Definition: StandardOptions.C:34
static Archive * new_Archive(const std::string &class_name)
Factory returns a null-constructed instance of the named class.
Definition: Archive.C:104
virtual unsigned get_nchan() const =0
Get the number of frequency channels used.
virtual void set_poln_calibrated(bool done=true)=0
Set the value to be returned by get_poln_calibrated.
void set_threshold(float sigma)
Set the threshold below which samples are included in the baseline.
Definition: GaussianBaseline.C:39
virtual Profile * clone() const
returns a pointer to a new copy of self
Definition: Profile.C:124
Calculates the signal-to-noise ratio using a ProfileWeightFunction.
Definition: AdaptiveSNR.h:26
Plots a single pulse profile.
Definition: ProfilePlot.h:26
void set_centre(double)
Set the phase of the standard profile centre.
Definition: SimPolnTiming.C:151
void set_standard(Archive *)
Set the archive to be used as a standard.
Definition: SimPolnTiming.C:158
Simulated polarimetric pulse profile.
Definition: General/Pulsar/SyntheticPolnProfile.h:28
virtual void set_dispersion_measure(double dm)=0
Set the dispersion measure (in )
virtual void run()
The main loop.
Definition: Application.C:168
Remove a variable baseline from each profile.
Definition: RemoveVariableBaseline.h:29
Reference::To< ScalarParameter > line_of_sight
bool vary_line_of_sight
Vary the line of sight.
Definition: General/Pulsar/SimPolnTiming.h:96
virtual double get_centre_frequency() const =0
Get the centre frequency of the observation.
Integration * get_Integration(unsigned subint)
Return pointer to the specified Integration.
Definition: IntegrationManager.C:41
static Functor< void(Archive *) > remove_baseline_strategy
The default baseline removal strategy.
Definition: Archive.h:572
Definition: MoreProfiles.h:24
void set_height(double height)
Calculates the signal-to-noise ratio in the Fourier domain.
Definition: FourierSNR.h:26
Array of Profiles integrated over the same time interval.
Definition: Integration.h:37
Adaptively computes the baseline, assuming normally distributed noise.
Definition: GaussianBaseline.h:70
static Option< bool > rotate_in_phase_domain
When true, Profile::rotate shifts bins in the phase domain.
Definition: Profile.h:56
Standard interpreter command line options.
Definition: StandardOptions.h:26
float measurement_noise
Relative noise in simulated observations.
Definition: General/Pulsar/SimPolnTiming.h:90
A Plot with a PlotFrame.
Definition: FramedPlot.h:25
void set_model(MEAL::RotatingVectorModel *model)
Set the model to be interfaced.
Definition: RotatingVectorModelOptions.h:41
float max(int bin_start=0, int bin_end=0) const
Returns the maximum amplitude.
Definition: Profile.C:651
Profile * get_Profile(unsigned subint, unsigned pol, unsigned chan)
Return pointer to the specified profile.
Definition: Archive.C:270
void set_turns(float)
Set the width of the smoothing window in turns.
Definition: Smooth.C:23
Find the baseline from the total integrated total intensity profile.
Definition: RemoveBaseline.h:70
MJD end_time() const
Return the MJD at the end of the last sub-integration.
Definition: Archive.C:308
RotatingVectorModel command line options.
Definition: RotatingVectorModelOptions.h:25
static bool verbose
Verbosity flag.
Definition: Plot.h:33
MEAL::Gaussian gaussian
The gaussian total intensity profile.
Definition: General/Pulsar/SimPolnTiming.h:66
void set_measure(double measure)
Set the correction measure.
Definition: ColdPlasma.h:227
Finds the phase window in which the smoothed Profile is an extremum.
Definition: BaselineWindow.h:28
virtual void add(Item *)
MJD start_time() const
Return the MJD at the start of the first sub-integration.
Definition: Archive.C:299
std::string get_help_footer() const
void set_ellipticity(unsigned ireceptor, const Estimate< double > &chi)
Set the ellipticity, , of the specified receptor in radians.
Definition: Feed.C:149
bool verbose
Definition: timer++.C:25
virtual double get_bandwidth() const =0
Get the overall bandwidth of the observation.
void set_maximum_harmonic(unsigned max)
Set the maximum number of harmonics to include in fit.
Definition: PolnProfileFit.C:115
Profile smoothing algorithms.
Definition: Smooth.h:28
virtual void get_weight(PhaseWeight *weight)
Returns a PhaseWeight with the Profile attribute set.
Definition: ProfileWeightFunction.C:26
virtual void set_Profile(const Profile *)
Set the Profile from which the PhaseWeight will be derived.
Definition: ProfileWeightFunction.C:20
Simulates full-Stokes arrival time estimation.
Definition: General/Pulsar/SimPolnTiming.h:49
MEAL::RotatingVectorModel rvm
The rotating vector model used to describe the position angle.
Definition: General/Pulsar/SimPolnTiming.h:69
static Option< float > default_duty_cycle
fractional phase window used in most functions
Definition: Profile.h:62
Stores Calibrator parameters in an Archive.
Definition: CalibratorExtension.h:27
Calculates profile shifts by fitting to a template/standard.
Definition: ProfileShiftFit.h:48
virtual void set_very_verbose()
Operate in very verbose mode.
Definition: Application.C:74
void set_standard(const Profile *profile)
Set the standard against which the S/N will be calculated.
Definition: StandardSNR.C:11
void transform(Archive *)
Remove the baseline.
Definition: RemoveBaseline.C:31
Models a pulse profile using multiple components.
Definition: ComponentModel.h:34
virtual void plot(const Archive *)
Plot in the current viewport.
Definition: SimplePlot.C:15
std::string get_filename() const
Get the name of the file to which the archive will be unloaded.
Definition: Archive.h:108
double obsbw
Observed bandwidth.
Definition: FITSHdrExtension.h:226
static unsigned verbose
A verbosity flag that can be set for debugging purposes.
Definition: IntegrationManager.h:38
Range slope
Number of steps when varying the RVM orientation.
Definition: General/Pulsar/SimPolnTiming.h:99
void set_baseline(float)
The the off-pulse baseline mean.
Definition: SyntheticPolnProfile.C:71
void revert(Archive *)
Undo the correction.
Definition: Dispersion.C:91
void stats(double *mean, double *variance=0, double *varmean=0, int bin_start=0, int bin_end=0) const
Calculates the mean, variance, and variance of the mean.
Definition: Profile_stats.C:27
Plots images of something as a function of pulse phase vs something.
Definition: PhaseVsFrequency.h:26
void fscrunch(unsigned nscrunch=0)
Integrate profiles in frequency.
Definition: Archive_fscrunch.C:17
const std::string get_message() const
State pscrunch(State state)
Profile smoothing algorithms that automatically pick smoothing size based on profile SNR.
Definition: AdaptiveSmooth.h:25
void set_prefix_name(bool flag)
Defines the PSRCHIVE library.
Definition: CalSource.h:17
virtual std::string help(bool show_default_values=false, bool show_header=false, const char *indent=0)
Manages arrival time estimation.
Definition: ArrivalTime.h:40
const Profile * get_Profile(const Archive *data, Index subint, Index pol, Index chan)
Return the requested profile, cloning and integrating when needed.
Definition: Index.C:24
void set_degree(MEAL::Univariate< MEAL::Scalar > *)
Set the functional form of the degree of polarization.
Definition: SyntheticPolnProfile.C:39
virtual void set_faraday_corrected(bool done=true)=0
Set the value to be returned by get_ism_rm_corrected.
const ExtensionType * get() const
Template method searches for an Extension of the specified type.
Provides a text interface to create new plots.
Definition: PlotFactory.h:27
void pscrunch()
Integrate profiles in polarization.
Definition: Archive_pscrunch.C:16
Computes pulse profile statistics.
Definition: ProfileStats.h:35
void unload(const char *filename=0) const
Write the archive to filename.
Definition: Archive_unload.C:36
void boost_around()
Find the phase shift due to boosts of varying orientation.
Definition: SimPolnTiming.C:340
const PolnProfile * new_Stokes(const Archive *, unsigned sub, unsigned chan)
Return a newly constructed PolnProfile with state == Stokes.
Definition: Polarization.C:15
Profile * get_Profile(unsigned ipol, unsigned ichan)
Returns a pointer to the Profile given by the specified indeces.
Definition: Integration.C:306
PolnProfileFit fit
The arrival time estimation algorithm.
Definition: General/Pulsar/SimPolnTiming.h:63
virtual void set_rotation_measure(double rm)=0
Set the rotation measure (in )
void transform(Archive *)
Remove the baseline.
Definition: RemoveVariableBaseline.C:62
void set_width(double width)
virtual unsigned get_nbin() const =0
Get the number of pulsar phase bins used.
Calculates the signal-to-noise ratio by fitting against a standard.
Definition: StandardSNR.h:27
void run_simulation()
Run the simulation, outputting results to cout.
Definition: SimPolnTiming.C:182
void susceptibility()
Account for noise in the standard profile.
Definition: SimPolnTiming.C:278
unsigned nbin
Number of bins in pulse profile.
Definition: General/Pulsar/SimPolnTiming.h:72
void add_options(CommandLine::Menu &)
Add options to the menu.
Definition: RotatingVectorModelOptions.C:24
Unload interpreter command line options.
Definition: UnloadOptions.h:26
std::string title
Title written over plot.
Definition: General/Pulsar/SimPolnTiming.h:124
void uniform_weight(float new_weight=1.0)
Set the weight of each profile to the given number.
Definition: Integration.C:706
Range dgain
Number of steps when varying the differental gain.
Definition: General/Pulsar/SimPolnTiming.h:107
Base class of all plotters.
Definition: Plot.h:28
void set_width(double width)
void set_baseline_estimator(ProfileWeightFunction *function)
Set the function used to compute the baseline.
Definition: AdaptiveSNR.C:29
int find_max_bin(int bin_start=0, int bin_end=0) const
Returns the bin number with the maximum amplitude.
Definition: Profile.C:622
virtual Profile * get_Profile(unsigned i)
get the ith Profile
Definition: MoreProfiles.C:57
Corrects Faraday rotation.
Definition: FaradayRotation.h:37
void sum(const Profile *profile)
add profile to this
Definition: Profile.C:336
Algorithms that combine Integration data.
Definition: TimeAppend.h:24
Reads and writes the timer archive file format.
Definition: TimerArchive.h:29
virtual void set_state(Signal::State state)=0
Set the state of the profile data.
Pulsar data processing command language interpreter.
Definition: Interpreter.h:57
virtual unsigned get_size() const
get the size of the profile vector
Definition: MoreProfiles.C:44
Smooths a Profile using the median over a boxcar.
Definition: SmoothMedian.h:29
SyntheticPolnProfile generate
The synthetic polarimetric profile generator.
Definition: General/Pulsar/SimPolnTiming.h:60

Generated using doxygen 1.8.17