PavApp.h
1/*
2 * Copyright (c) 2007 by David Smith
3 * Licensed under the Academic Free License version 2.1
4 */
5
6
7
8
9#ifndef PAV_APP_H_
10#define PAV_APP_H_
11
12
13
14#include "Pulsar/PlotFactory.h"
15#include "Pulsar/Plot.h"
16
17#include "Pulsar/Archive.h"
18#include "Pulsar/Interpreter.h"
19
20#include "Pulsar/GaussianBaseline.h"
21#include "Pulsar/PhaseWeight.h"
22#include "Pulsar/Profile.h"
23
24#include <Pulsar/Integration.h>
25#include <Pulsar/IntegrationOrder.h>
26#include <Pulsar/PeriastronOrder.h>
27#include <Pulsar/BinaryPhaseOrder.h>
28#include <Pulsar/BinLngPeriOrder.h>
29#include <Pulsar/BinLngAscOrder.h>
30
31#include <Pulsar/StokesPlot.h>
32#include <Pulsar/StokesCylindrical.h>
33
34#include "TextInterface.h"
35#include "strutil.h"
36#include "dirutil.h"
37#include "getopt.h"
38#include "cpgplot.h"
39
40#include "ColourMap.h"
41
42#include <tostring.h>
43
44#include <cpgplot.h>
45
46#include <sstream>
47
48#include <unistd.h>
49
50using std::string;
51using std::vector;
52using Pulsar::Archive;
53using Pulsar::Option;
54using Pulsar::Plot;
55using Reference::To;
56
57
58
59class PavApp
60{
61public:
62 PavApp();
63
64 int run( int argc, char *argv[] );
65private:
66
67 static Option<string> default_plot_device;
68
69 struct FilePlots
70 {
71 string filename;
72 Reference::To<Archive> archive;
73 vector< Reference::To<Plot> > plots;
74 };
75
76 vector< FilePlots > plots;
77
78 template< class PC > void SetPlotOptions( string cmd )
79 {
80 vector< FilePlots >::iterator fit;
81 for( fit = plots.begin(); fit != plots.end(); fit ++ )
82 {
83 vector< Reference::To<Plot> >::iterator pit;
84 for( pit = (*fit).plots.begin(); pit != (*fit).plots.end(); pit ++ )
85 {
86 Reference::To<PC> sp = dynamic_cast<PC*>( (*pit).get() );
87 if( sp )
88 {
89 try { sp->configure( cmd ); } catch( Error& e ) {}
90 }
91 }
92 }
93 }
94
95 std::string GetBandpassOrSpectrumPlot( Reference::To<Archive> archive );
96
97 void PrintUsage( void );
98
99 void SetStokesPlotToQU( void );
100 void SetPhaseZoom( double min_phase, double max_phase );
101 void SetFreqZoom( double min_freq, double max_freq );
102 void PavSpecificOptions( void );
103 void PavSpecificLabels( Pulsar::Archive* archive );
104 void CreatePlotsList( vector< string > filenames, vector< string > plot_ids );
105 void SetCmdLineOptions( vector< string > options );
106 bool CheckColour( void );
107 float PADegreesToTurns( const int deg );
108
109 bool have_colour;
110 int ipol;
111 int fsub, lsub;
112 int isubint;
113 int ichan;
114 double rot_phase;
115 bool svp;
116 bool publn;
117 bool axes;
118 bool labels;
119 unsigned int n1, n2;
120 double min_freq;
121 double max_freq;
122 double min_phase;
123 double max_phase;
124 double reference_position_angle;
125 double position_angle_height;
126 double border;
127 bool dark;
128 double y_max;
129 double y_min;
130 double truncate_amp;
131 pgplot::ColourMap::Name colour_map;
132
133 bool cbppo;
134 bool cbpao;
135 bool cblpo;
136 bool cblao;
137
138 bool pa_ext;
139
140 bool plot_error_box;
141
142 bool freq_under_name;
143
144 float user_character_height;
145
146 float pa_min, pa_max;
147
148 bool label_degrees;
149 bool centre_profile;
150 bool remove_baseline;
151
152 unsigned int ronsub;
153};
154
155#endif
156
157
158
159
160
161
The primary interface to pulsar observational data.
Definition Archive.h:46
Configuration option.
Definition Config.h:69
Base class of all plotters.
Definition Plot.h:23
Name
Available colour map names.
Definition ColourMap.h:25
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)

Generated using doxygen 1.14.0