ExampleArchive.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2003 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/Base/Classes/Pulsar/ExampleArchive.h
10 
11 #ifndef __ExampleArchive_h
12 #define __ExampleArchive_h
13 
14 #include "Pulsar/BasicArchive.h"
15 #include "Pulsar/Agent.h"
16 
17 namespace Pulsar {
18 
20 
25  class ExampleArchive : public BasicArchive {
26 
27  public:
28 
31 
33  ExampleArchive (const ExampleArchive& archive);
34 
36  ~ExampleArchive ();
37 
39  const ExampleArchive& operator = (const ExampleArchive& archive);
40 
42  ExampleArchive (const Archive& archive);
43 
45  void copy (const Archive& archive);
46 
48  ExampleArchive* clone () const;
49 
50  protected:
51 
53  virtual void load_header (const char* filename);
54 
56  virtual Integration*
57  load_Integration (const char* filename, unsigned index);
58 
60  bool can_unload () const { return false; }
61 
63  virtual void unload_file (const char* filename) const;
64 
65  // Advocates the use of the ExampleArchive plugin
66  class Agent;
67 
69  friend class Archive::Advocate<ExampleArchive>;
70 
71  private:
72 
74  void init ();
75 
76  };
77 
78 
79  // Advocates the use of the ExampleArchive plugin
80  class ExampleArchive::Agent : public Archive::Advocate<ExampleArchive> {
81 
82  public:
83 
84  Agent () { }
85 
87  bool advocate (const char* filename);
88 
90  std::string get_name () { return "ExampleArchive"; }
91 
93  std::string get_description ();
94 
95  };
96 
97 }
98 
99 #endif
Application with basic command line options.
Definition: Application.h:30
ExampleArchive()
Default constructor.
Definition: ExampleArchive.C:21
const ExampleArchive & operator=(const ExampleArchive &archive)
Assignment operator.
void set_amps(const T *data)
set the amplitudes array equal to the contents of the data array
Definition: ProfileAmps.h:89
Signal::Scale scale
The scale in which flux density is measured.
Definition: BasicArchive.h:177
void set_centre_frequency(unsigned ichan, double frequency)
Set the Profile centre frequency attributes of the given channel.
Definition: Integration.C:372
Any quantity recorded as a function of pulse phase.
Definition: Profile.h:45
The primary interface to pulsar observational data.
Definition: Archive.h:45
void scale(double scale)
multiplies each bin of the profile by scale
Definition: Profile.C:311
Loads and unloads Example Pulsar archives.
Definition: ExampleArchive.h:30
ExampleArchive * clone() const
Return a new copy-constructed ExampleArchive instance.
Definition: ExampleArchive.C:72
Array of Profiles integrated over the same time interval.
Definition: Integration.h:37
Standard interpreter command line options.
Definition: StandardOptions.h:26
virtual Integration * load_Integration(const char *filename, unsigned index)
Load a single Integration from filename, returning new instance.
Definition: ExampleArchive.C:146
virtual void set_epoch(const MJD &mjd)
Set the epoch of the rising edge of bin zero.
Definition: BasicIntegration.h:63
BasicIntegration class.
Definition: BasicIntegration.h:24
virtual void add(Item *)
virtual void set_folding_period(double seconds)
Set the folding period (in seconds)
Definition: BasicIntegration.h:73
~ExampleArchive()
Destructor.
Definition: ExampleArchive.C:26
bool can_unload() const
The unload_file method is not implemented.
Definition: ExampleArchive.h:70
Defines the PSRCHIVE library.
Definition: CalSource.h:17
virtual void load_header(const char *filename)
Load the Example header information from filename.
Definition: ExampleArchive.C:79
virtual void unload_file(const char *filename) const
Unload the ExampleArchive (header and Integration data) to filename.
Definition: ExampleArchive.C:190
virtual void set_duration(double seconds)
Set the total time integrated (in seconds)
Definition: BasicIntegration.h:68
Profile * get_Profile(unsigned ipol, unsigned ichan)
Returns a pointer to the Profile given by the specified indeces.
Definition: Integration.C:306
Unload interpreter command line options.
Definition: UnloadOptions.h:26
void copy(const Archive &archive)
Copy all of the class attributes and the selected Integration data.
Definition: ExampleArchive.C:49

Generated using doxygen 1.8.17