UVMArchive.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2016 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/Base/Formats/UVM/Pulsar/UVMArchive.h
10 
11 #ifndef __UVMArchive_h
12 #define __UVMArchive_h
13 
14 #include "Pulsar/BasicArchive.h"
15 #include "Pulsar/Agent.h"
16 #include "Pulsar/Config.h"
17 
18 namespace Pulsar {
19 
21  class UVMArchive : public BasicArchive {
22 
23  public:
24 
27 
29  UVMArchive ();
30 
32  UVMArchive (const UVMArchive& archive);
33 
35  ~UVMArchive ();
36 
38  const UVMArchive& operator = (const UVMArchive& archive);
39 
41  UVMArchive (const Archive& archive);
42 
44  void copy (const Archive& archive);
45 
47  UVMArchive* clone () const;
48 
50  virtual void load_header (const char* filename);
51 
52  protected:
53 
55  virtual Integration*
56  load_Integration (const char* filename, unsigned subint);
57 
59  bool can_unload () const { return false; }
60 
62  void unload_file (const char* filename) const { }
63 
64  friend class Archive::Advocate<UVMArchive>;
65 
67  class Agent : public Archive::Advocate<UVMArchive> {
68 
69  public:
70 
71  Agent () { }
72 
74  bool advocate (const char* filename);
75 
77  std::string get_name () { return "UVM"; }
78 
80  std::string get_description ();
81 
82  };
83 
85  double integration_length;
86 
88  MJD epoch;
89 
91  double period;
92 
93  private:
94 
96  void init ();
97 
98  void* header_ptr;
99  int program;
100 
101  };
102 
103 
104 }
105 
106 #endif
Loads UVM data files.
Definition: UVMArchive.h:26
std::string get_name()
Return the name of the TimerArchive plugin.
Definition: UVMArchive.h:87
const Integration * get_Integration(const Archive *data, Index subint)
Return the requested profile, cloning and integrating when needed.
Definition: Index.C:118
void set_centre_frequency(unsigned ichan, double frequency)
Set the Profile centre frequency attributes of the given channel.
Definition: Integration.C:372
MJD epoch
The epoch of the observation.
Definition: UVMArchive.h:98
virtual void set_epoch(const MJD &mjd)=0
Set the epoch of the rising edge of bin zero.
The primary interface to pulsar observational data.
Definition: Archive.h:45
static Option< bool > include_offpulse_region
Load the phase bins identified as part of the off-pulse baseline.
Definition: UVMArchive.h:36
const UVMArchive & operator=(const UVMArchive &archive)
Assignment operator.
UVMArchive * clone() const
Return a new copy-constructed UVMArchive instance.
Definition: UVMArchive.C:86
virtual Integration * load_Integration(const char *filename, unsigned subint)
Load the specified Integration from filename, returning new instance.
Definition: UVMArchive.C:247
double integration_length
The integration length.
Definition: UVMArchive.h:95
Array of Profiles integrated over the same time interval.
Definition: Integration.h:37
void unload_file(const char *filename) const
Unload the UVMArchive (header and Integration data) to filename.
Definition: UVMArchive.h:72
virtual void load_header(const char *filename)
Load the UVM header information from filename.
Definition: UVMArchive.C:93
double period
The folding period.
Definition: UVMArchive.h:101
virtual void set_duration(double seconds)=0
Set the total time integrated (in seconds)
This class registers the UVMArchive plugin class for use.
Definition: UVMArchive.h:77
void copy(const Archive &archive)
Copy all of the class attributes and the selected Integration data.
Definition: UVMArchive.C:63
std::string get_description()
Return description of this plugin.
Definition: UVMArchive.C:255
UVMArchive()
Default constructor.
Definition: UVMArchive.C:35
bool can_unload() const
The unload_file method is implemented.
Definition: UVMArchive.h:69
Defines the PSRCHIVE library.
Definition: CalSource.h:17
bool advocate(const char *filename)
Advocate the use of TimerArchive to interpret filename.
Definition: UVMArchive.C:261
~UVMArchive()
Destructor.
Definition: UVMArchive.C:40
Profile * get_Profile(unsigned ipol, unsigned ichan)
Returns a pointer to the Profile given by the specified indeces.
Definition: Integration.C:306
virtual void set_folding_period(double seconds)=0
Set the folding or topocentric pulsar period (in seconds)
virtual void set_gate_duty_cycle(double turns)
Set the fraction of the pulse period recorded (in turns)
Definition: Integration.h:224

Generated using doxygen 1.8.17