pdv_KtZ_Archive.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2018 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/Base/Formats/pdv_KtZ_/Pulsar/pdv_KtZ_Archive.h
10 
11 #ifndef __pdv_KtZ_Archive_h
12 #define __pdv_KtZ_Archive_h
13 
14 #include "Pulsar/BasicArchive.h"
15 #include "Pulsar/Agent.h"
16 
17 namespace Pulsar {
18 
20  class pdv_KtZ_Archive : public BasicArchive {
21 
22  public:
23 
26 
28  pdv_KtZ_Archive (const pdv_KtZ_Archive& archive);
29 
32 
34  const pdv_KtZ_Archive& operator = (const pdv_KtZ_Archive& archive);
35 
37  pdv_KtZ_Archive (const Archive& archive);
38 
40  void copy (const Archive& archive);
41 
43  pdv_KtZ_Archive* clone () const;
44 
46  virtual void load_header (const char* filename);
47 
48  protected:
49 
51  virtual Integration*
52  load_Integration (const char* filename, unsigned subint);
53 
55  bool can_unload () const { return false; }
56 
58  void unload_file (const char* filename) const;
59 
60  friend class Archive::Advocate<pdv_KtZ_Archive>;
61 
63  class Agent : public Archive::Advocate<pdv_KtZ_Archive> {
64 
65  public:
66 
67  Agent () { }
68 
70  bool advocate (const char* filename);
71 
73  std::string get_name () { return "pdv_KtZ"; }
74 
76  std::string get_description ();
77 
78  };
79 
81  double integration_length;
82 
84  MJD epoch;
85 
87  double period;
88 
89  private:
90 
92  void init ();
93 
94  };
95 
96 
97 }
98 
99 #endif
Jones< double > evaluate(std::vector< Jones< double > > *grad=0) const
const ScalarMath exp(const ScalarMath &x)
Calibrator
Definition: Integration.h:429
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)
double period
The folding period.
Definition: pdv_KtZ_Archive.h:97
void set_bybin(bool t)
Run the algorithm on the spectra of each bin.
Definition: ChannelZapMedian.h:77
double get_param(unsigned) const
Get the value of the specified model parameter.
Definition: PolnCalibratorExtension.C:285
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.
virtual void plot(const Archive *)=0
Plot in the current viewport.
Loads and unloads PSRFITS archives.
Definition: FITSArchive.h:63
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
This class registers the pdv_KtZ_Archive plugin class for use.
Definition: pdv_KtZ_Archive.h:73
van Straten (2004; ApJSS 152:129), equation 18
Definition: CalibratorTypes.h:155
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
static bool no_amps
When true, no memory is allocated for amps.
Definition: ProfileAmps.h:38
double mean(float phase, float duty_cycle=default_duty_cycle) const
Convenience interface to stats, returns only the mean.
Definition: Profile_stats.C:121
void convert_state(Signal::State state)
Convert data to the specified state.
Definition: Archive_convert_state.C:14
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
static bool verbose
Verbosity flag.
Definition: CalibratorPlotter.h:35
Plots images of something as a function of pulse phase vs something.
Definition: PhaseVsTime.h:26
void remove_baseline()
Remove the baseline from all profiles.
Definition: Archive_remove_baseline.C:17
virtual TextInterface::Parser * get_interface()=0
Get the text interface to the configuration attributes.
float min(int bin_start=0, int bin_end=0) const
Returns the minimum amplitude.
Definition: Profile.C:665
const float * get_amps() const
Return a pointer to the amplitudes array.
Definition: ProfileAmps.C:141
Transformation * get_transformation(unsigned c)
Get the transformation for the specified frequency channel.
Definition: PolnCalibratorExtension.C:157
std::string get_name()
Return the name of the TimerArchive plugin.
Definition: pdv_KtZ_Archive.h:83
float get_weight() const
get the weight of the profile
Definition: Profile.h:207
unsigned get_nparam() const
Unloads Pulsar::SystemCalibrator solution to file.
Definition: SystemCalibratorUnloader.h:24
char * getDMS(char *str, int places=3) const
virtual void set_filename(const std::string &)
Set the filename of the result.
Definition: SystemCalibratorUnloader.C:29
Argument * find(const std::string &name)
double get_centre_frequency(unsigned ichan) const
Get the Profile centre frequency attribute of the given channel.
Definition: Integration.C:359
const Integration * get_Integration(const Archive *data, Index subint)
Return the requested profile, cloning and integrating when needed.
Definition: Index.C:118
PolnCalibrator with estimated calibrator Stokes parameters.
Definition: SystemCalibrator.h:43
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.
Calculates the signal-to-noise ratio by fitting against a standard.
Definition: FortranSNR.h:27
Plots a single pulse profile.
Definition: StokesSpherical.h:27
void set_amps(const T *data)
set the amplitudes array equal to the contents of the data array
Definition: ProfileAmps.h:89
Stores a weight for each Profile phase bin.
Definition: PhaseWeight.h:29
MJD epoch
The epoch of the observation.
Definition: pdv_KtZ_Archive.h:94
float find_min_phase(float duty_cycle=default_duty_cycle) const
Returns the phase of the centre of the region with minimum mean.
Definition: Profile_find_minmax_phase.C:21
void counter_drift(Archive *archive, double trial_p, double trial_pdot=0.0, MJD reference_time=MJD::zero)
Rotates subints to counter a drifting pulse due to incorrect P/Pdot.
Definition: counter_drift.C:17
pdv_KtZ_Archive * clone() const
Return a new copy-constructed pdv_KtZ_Archive instance.
Definition: pdv_KtZ_Archive.C:80
const ScalarMath sin(const ScalarMath &x)
void set_value(const std::string &name, const std::string &value)
virtual unsigned get_nchan() const
Get the number of frequency channels.
Definition: CalibratorExtension.C:83
Plots Calibrator parameters.
Definition: CalibratorPlotter.h:24
PlotScale * get_y_scale(bool allow_transpose)
Get the x-scale.
Definition: PlotFrame.C:213
Any quantity recorded as a function of pulse phase.
Definition: Profile.h:45
const pdv_KtZ_Archive & operator=(const pdv_KtZ_Archive &archive)
Assignment operator.
The primary interface to pulsar observational data.
Definition: Archive.h:45
static Archive * load(const std::string &name)
Factory returns a new instance loaded from filename.
Definition: Archive_load.C:28
Plots the various components of a ReceptionCalibrator.
Definition: ReceptionCalibratorPlotter.h:26
Contains information about the receiver and receiver platform.
Definition: Receiver.h:28
unsigned npanel
Number of panels (vertical)
Definition: CalibratorPlotter.h:60
static void set_verbosity(unsigned level)
Set the verbosity level (0 to 3)
Definition: Archive_verbose.C:19
char code(const std::string &telescope_name)
void apply()
Apply the current attributes.
Definition: ColourMap.C:47
unsigned get_nbin() const
Return the number of bins.
Definition: ProfileAmps.h:50
virtual Integration * load_Integration(const char *filename, unsigned subint)
Load the specified Integration from filename, returning new instance.
Definition: pdv_KtZ_Archive.C:365
Stores Parkes Wideband Correlator parameters.
Definition: WidebandCorrelator.h:27
const ScalarMath pow(const ScalarMath &x, const ScalarMath &y)
pdv_KtZ_Archive()
Default constructor.
Definition: pdv_KtZ_Archive.C:29
double get_variance(unsigned) const
Get the variance of the specified model parameter.
Definition: PolnCalibratorExtension.C:297
virtual void load_header(const char *filename)
Load the pdv_KtZ_ header information from filename.
Definition: pdv_KtZ_Archive.C:154
const ScalarMath sqrt(const ScalarMath &x)
Stores the Stokes parameters of the reference source.
Definition: CalibratorStokes.h:28
Type * get() const
Solve the measurement equation using GNU Scientific Library.
Definition: ReceptionModelSolveGSL.h:24
const ScalarMath abs(const ScalarMath &x)
void fscrunch(Container *, const ScrunchFactor &)
Integrate frequency channels.
Definition: ScrunchFactor.h:102
static unsigned verbose
Verbosity level.
Definition: Calibrator.h:40
The scale on an axis.
Definition: PlotScale.h:26
Solve the measurement equation by non-linear least squares minimization.
Definition: ReceptionModelSolver.h:26
virtual unsigned get_nchan() const =0
Get the number of frequency channels used.
std::vector< Reference::To< const Profile > > profiles
the vector of profiles to be drawn
Definition: ProfileVectorPlotter.h:47
void shift(unsigned npts, float *arr, double shift)
virtual Signal::State get_state() const =0
Get the state of the profile data.
void cal_levels(std::vector< std::vector< Estimate< double > > > &hi, std::vector< std::vector< Estimate< double > > > &lo) const
Returns the mean hi/lo and variance of the mean hi/lo of every profile.
Definition: Integration_cal_levels.C:16
void set_Estimate(unsigned index, const Estimate< double > &param)
double get_rotation_measure() const
Get the auxiliary rotation measure.
Definition: AuxColdPlasmaMeasures.C:41
Plots a single pulse profile.
Definition: ProfilePlot.h:26
~pdv_KtZ_Archive()
Destructor.
Definition: pdv_KtZ_Archive.C:34
float get_weight(unsigned ichan) const
Get the Profile weight attribute of the given channel.
Definition: Integration.C:388
void set_paz_report(bool t)
Print equivalent paz command on cout.
Definition: ChannelZapMedian.h:83
virtual void set_dispersion_measure(double dm)=0
Set the dispersion measure (in )
virtual void unload(SystemCalibrator *)
Unload the SystemCalibrator solution using the current settings.
Definition: SystemCalibratorUnloader.C:50
virtual void set_dedispersed(bool done=true)=0
Set the value to be returned by get_dedispersed.
Remove a variable baseline from each profile.
Definition: RemoveVariableBaseline.h:29
International Terrestrial Reference Frame Extension.
Definition: ITRFExtension.h:27
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
void set_projection_corrected(bool val)
Set true when receptor projection onto sky has been corrected.
Definition: Receiver.h:172
float find_max_phase(float duty_cycle=default_duty_cycle) const
Returns the phase of the centre of the region with maximum mean.
Definition: Profile_find_minmax_phase.C:43
unsigned get_nparam_infit() const
Communicates CalibratorStokes parameters to plotting routines.
Definition: CalibratorStokesInfo.h:26
std::string name() const
Implements Measurement Equation Modeling (van Straten 2004)
Definition: ReceptionCalibrator.h:42
static size_t get_instance_count()
Array of Profiles integrated over the same time interval.
Definition: Integration.h:37
static bool verbose
Instrumental gain, differential gain, and differential phase.
Definition: SingleAxis.h:38
Standard interpreter command line options.
Definition: StandardOptions.h:26
static bool very_verbose
void set_name(Name name)
Set the colour map name.
Definition: ColourMap.C:42
BasicIntegration class.
Definition: BasicIntegration.h:24
float max(int bin_start=0, int bin_end=0) const
Returns the maximum amplitude.
Definition: Profile.C:651
char * getHMS(char *str, int places=3) const
Profile * get_Profile(unsigned subint, unsigned pol, unsigned chan)
Return pointer to the specified profile.
Definition: Archive.C:270
static Type * factory(const std::string &name)
Construct a new instance of Calibrator::Type, based on name.
Definition: CalibratorType.C:12
virtual void add_precondition(Functor< bool(Profile *, PhaseWeight *) >)
One or more preconditions can be added.
Definition: Mower.C:75
Find the baseline from each total intensity profile.
Definition: RemoveBaseline.h:85
Stores PolnCalibrator parameters in an Archive instance.
Definition: PolnCalibratorExtension.h:28
Reference::To< StaticEntry > entry
The parameters to match.
Definition: Database.h:220
const ProfileVectorPlotter * get_plotter() const
Provide limited access to the plotter.
Definition: FluxPlot.h:125
PlotScale * get_x_scale(bool allow_transpose)
Get the x-scale.
Definition: PlotFrame.C:189
Implements Measurement Equation Template Matching (van Straten 2013)
Definition: PulsarCalibrator.h:43
Stores digitizer statistics.
Definition: DigitiserStatistics.h:25
void set_weight(unsigned ichan, float weight)
Set the Profile weight attributes of the given channel.
Definition: Integration.C:401
MEAL::Complex2 * load_transformation(const std::string &filename)
Load a new transformation instance from file.
Definition: CalibratorType_factory.C:94
virtual void add(Item *)
Phenomenological description of the instrument.
Definition: ManualPolnCalibrator.h:27
T get_value() const
virtual MJD get_epoch() const
Get the reference epoch of the calibration experiment.
Definition: CalibratorExtension.C:58
virtual void get_xyz(double &x, double &y, double &z) const=0
double integration_length
The integration length.
Definition: pdv_KtZ_Archive.h:91
Definition: CalibratorType.h:30
bool verbose
Definition: timer++.C:25
virtual double get_bandwidth() const =0
Get the overall bandwidth of the observation.
T get(const std::string &keyword) const
virtual void set_program(const std::string &)
Set the name of the program; enables verbosity.
Definition: SystemCalibratorUnloader.C:24
double get_bandwidth() const
Get the bandwidth (in MHz)
Definition: Integration.C:445
bool get_valid() const
Get the model validity flag.
Definition: PolnCalibratorExtension.C:321
Correct the backend convention.
Definition: ProjectionCorrection.h:29
void set_window_size(unsigned size)
Set the size of the window over which median will be computed.
Definition: ChannelZapMedian.h:53
virtual PlotFrame * get_frame()
Get the frame.
Definition: FramedPlot.C:27
std::string get_description()
Return description of this plugin.
Definition: pdv_KtZ_Archive.C:377
void unload_file(const char *filename) const
Unload the pdv_KtZ_Archive (header and Integration data) to filename.
Definition: pdv_KtZ_Archive.C:371
double get_scale(size_t nfft, type t)
Polarimetric calibrators.
Definition: PolnCalibrator.h:41
void set_standard(const Profile *profile)
Set the standard against which the S/N will be calculated.
Definition: StandardSNR.C:11
Convenience interface to a bunch of regularly used colour maps.
Definition: ColourMap.h:26
float get_snr(const Profile *profile)
Return the signal to noise ratio based on the shift.
Definition: FortranSNR.C:40
const ScalarMath cos(const ScalarMath &x)
bool advocate(const char *filename)
Advocate the use of TimerArchive to interpret filename.
Definition: pdv_KtZ_Archive.C:383
Loads data from the ASCII output by pdv -KtZ
Definition: pdv_KtZ_Archive.h:25
void dedisperse()
Rotate the Profiles to remove dispersion delays b/w chans.
Definition: Archive_dedisperse.C:18
Plot * construct(std::string name)
Return a new instance of the named plot.
Definition: PlotFactory.C:169
Pulsar Observation Database.
Definition: Database.h:40
Plots the various components of a SystemCalibrator.
Definition: SystemCalibratorPlotter.h:27
Plots images of something as a function of pulse phase vs something.
Definition: PhaseVsFrequency.h:26
virtual void set_extension(const std::string &)
Set the extension used when creating a filename.
Definition: SystemCalibratorUnloader.C:34
virtual void set_archive_class(const std::string &)
Copy constructor.
Definition: SystemCalibratorUnloader.C:19
PhaseWeight * baseline() const
Return a new PhaseWeight instance with the baseline phase bins masked.
Definition: Profile_baseline.C:15
Adapts a VariableTransformation to a ManualPolnCalibrator.
Definition: ManualVariableTransformation.h:23
virtual Archive * clone() const =0
Return a new copy constructed instance equal to this.
float get_chisq() const
void fscrunch(unsigned nscrunch=0)
Integrate profiles in frequency.
Definition: Archive_fscrunch.C:17
const std::string get_message() const
double get_dispersion_measure() const
Get the auxiliary dispersion measure.
Definition: AuxColdPlasmaMeasures.C:29
void set(Archive *data)
set the current Archive
Definition: Interpreter.C:441
virtual void plot(const Calibrator *calibrator)
Plot the Pulsar::Calibrator.
Definition: CalibratorPlotter.C:37
void transform(Integration *)
Set the Profile from which baseline PhaseWeight will be computed.
Definition: Mower.C:150
Defines the PSRCHIVE library.
Definition: CalSource.h:17
Uses a median smoothed spectrum to find birdies and zap them.
Definition: ChannelZapMedian.h:28
Physical parameterization of the instrumental response.
Definition: VariableBackend.h:35
virtual void remove(Item *)
Estimate< double > get_total(bool subtract_baseline=true) const
Returns the total flux of the on-pulse phase bins.
Definition: ProfileStats.C:251
static bool trust_pointing_feed_angle
Always trust the feed angle stored in the Pointing extension.
Definition: ProjectionCorrection.h:37
Provides a text interface to create new plots.
Definition: PlotFactory.h:27
void pscrunch()
Integrate profiles in polarization.
Definition: Archive_pscrunch.C:16
Stores parameters used to correct auxiliary dispersion and birefringence.
Definition: AuxColdPlasmaMeasures.h:24
Describes Database matching criteria.
Definition: Database.h:215
void copy(const Archive &archive)
Copy all of the class attributes and the selected Integration data.
Definition: pdv_KtZ_Archive.C:57
Computes pulse profile statistics.
Definition: ProfileStats.h:35
virtual TextInterface::Parser * get_frame_interface()=0
Get the text interface to the frame attributes.
virtual double get_dispersion_measure() const =0
Get the dispersion measure (in )
bool can_unload() const
The unload_file method is implemented.
Definition: pdv_KtZ_Archive.h:65
virtual void set_weight(float)
set the weight of the profile
Definition: Profile.C:185
Removes broad-band impulsive spikes from pulse profiles.
Definition: LawnMower.h:32
Profile * get_Profile(unsigned ipol, unsigned ichan)
Returns a pointer to the Profile given by the specified indeces.
Definition: Integration.C:306
void transform(Archive *)
Remove the baseline.
Definition: RemoveVariableBaseline.C:62
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
Solve the measurement equation by non-linear least squares minimization.
Definition: ReceptionModelSolveMEAL.h:24
Name
Available colour map names.
Definition: ColourMap.h:35
static bool trust_pointing_para_angle
Trust Pointing parallactic angle more than computed value.
Definition: ProjectionCorrection.h:34
void set_profile(const Profile *)
Set the Profile from which statistics will be derived.
Definition: ProfileStats.C:115
Unload interpreter command line options.
Definition: UnloadOptions.h:26
PolnProfile * new_PolnProfile(unsigned ichan)
Returns a pointer to a new PolnProfile instance.
Definition: Integration_new_PolnProfile.C:16
void uniform_weight(float new_weight=1.0)
Set the weight of each profile to the given number.
Definition: Integration.C:706
Estimate< double > get_Estimate(unsigned index) const
virtual void resize(unsigned nbin)
resize the data area
Definition: Profile.C:134
bool has_fluxcal() const
Return true if any flux calibrator observations are available.
Definition: ReceptionCalibrator.C:569
unsigned get_nfree() const
Base class of all plotters.
Definition: Plot.h:28
Alternative ways of ordering Integration instances.
Definition: IntegrationOrder.h:29
Stores the properties of the plot frame.
Definition: PlotFrame.h:31
void sum(const Profile *profile)
add profile to this
Definition: Profile.C:336
Telescope pointing parameters recorded during the observation.
Definition: Pointing.h:27
virtual void erase(unsigned isubint)
Remove the specified sub-integration.
Definition: Archive_resize.C:94
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
unsigned nthread
void tscrunch(unsigned nscrunch=0)
Integrate profiles in time.
Definition: Archive_tscrunch.C:17
bool use_colour
Use colour in plots.
Definition: CalibratorPlotter.h:66
Intermediate storage of MEAL::Complex parameters.
Definition: PolnCalibratorExtension.h:135
Estimate< double > get_mean() const
Get the weighted mean of the Profile amplitudes.
Definition: PhaseWeight.C:334
virtual void setup()
Any extra setup before running main loop.
Definition: Application.C:248

Generated using doxygen 1.8.17