ASCIIArchive.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2006-2009 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/Base/Formats/ASCII/Pulsar/ASCIIArchive.h
10 
11 #ifndef __ASCIIArchive_h
12 #define __ASCIIArchive_h
13 
14 #include "Pulsar/BasicArchive.h"
15 #include "Pulsar/Agent.h"
16 
17 namespace Pulsar {
18 
20  class ASCIIArchive : public BasicArchive {
21 
22  public:
23 
26 
28  ASCIIArchive (const ASCIIArchive& archive);
29 
31  ~ASCIIArchive ();
32 
34  const ASCIIArchive& operator = (const ASCIIArchive& archive);
35 
37  ASCIIArchive (const Archive& archive);
38 
40  void copy (const Archive& archive);
41 
43  ASCIIArchive* 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 true; }
56 
58  virtual void unload_file (const char* filename) const;
59 
60  friend class Archive::Advocate<ASCIIArchive>;
61 
63  class Agent : public Archive::Advocate<ASCIIArchive> {
64 
65  public:
66 
67  Agent () { }
68 
70  bool advocate (const char* filename);
71 
73  std::string get_name () { return "ASCII"; }
74 
76  std::string get_description ();
77 
78  };
79 
81  double integration_length;
82 
84  MJD epoch;
85 
87  double period;
88 
90  void hashed_header (std::istream&);
91 
92  private:
93 
95  void init ();
96 
97  };
98 
99 
100 }
101 
102 #endif
bool advocate(const char *filename)
Advocate the use of TimerArchive to interpret filename.
Definition: ASCIIArchive.C:288
bool can_unload() const
The unload_file method is implemented.
Definition: ASCIIArchive.h:65
MJD epoch
The epoch of the observation.
Definition: ASCIIArchive.h:94
std::string get_name()
Return the name of the TimerArchive plugin.
Definition: ASCIIArchive.h:83
Loads ASCII data files also known as SIGPROC format.
Definition: ASCIIArchive.h:25
std::string get_name() const
Get the name of the receiver.
Definition: Receiver.h:90
Stores information about the instrument backend.
Definition: Backend.h:26
const Integration * get_Integration(const Archive *data, Index subint)
Return the requested profile, cloning and integrating when needed.
Definition: Index.C:118
StateType * get() const
Definition: Receiver.C:22
void set_centre_frequency(unsigned ichan, double frequency)
Set the Profile centre frequency attributes of the given channel.
Definition: Integration.C:372
The primary interface to pulsar observational data.
Definition: Archive.h:45
Contains information about the receiver and receiver platform.
Definition: Receiver.h:28
ASCIIArchive()
Default constructor.
Definition: ASCIIArchive.C:23
char code(const std::string &telescope_name)
virtual Integration * load_Integration(const char *filename, unsigned subint)
Load the specified Integration from filename, returning new instance.
Definition: ASCIIArchive.C:175
virtual void unload_file(const char *filename) const
Unload the ASCIIArchive (header and Integration data) to filename.
Definition: ASCIIArchive.C:238
const ASCIIArchive & operator=(const ASCIIArchive &archive)
Assignment operator.
std::string get_name() const
Return the name of the Backend.
Definition: Backend.C:83
Array of Profiles integrated over the same time interval.
Definition: Integration.h:37
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
double period
The folding period.
Definition: ASCIIArchive.h:97
Observation Information Extension.
Definition: ObsExtension.h:29
std::string get_description()
Return description of this plugin.
Definition: ASCIIArchive.C:282
std::string observer
Observer name.
Definition: ObsExtension.h:78
double integration_length
The integration length.
Definition: ASCIIArchive.h:91
virtual void set_folding_period(double seconds)
Set the folding period (in seconds)
Definition: BasicIntegration.h:73
void hashed_header(std::istream &)
Read more header information.
Definition: ASCIIArchive.C:134
Defines the PSRCHIVE library.
Definition: CalSource.h:17
virtual void load_header(const char *filename)
Load the ASCII header information from filename.
Definition: ASCIIArchive.C:81
ASCIIArchive * clone() const
Return a new copy-constructed ASCIIArchive instance.
Definition: ASCIIArchive.C:74
Profile * get_Profile(unsigned ipol, unsigned ichan)
Returns a pointer to the Profile given by the specified indeces.
Definition: Integration.C:306
~ASCIIArchive()
Destructor.
Definition: ASCIIArchive.C:28
void copy(const Archive &archive)
Copy all of the class attributes and the selected Integration data.
Definition: ASCIIArchive.C:51
This class registers the ASCIIArchive plugin class for use.
Definition: ASCIIArchive.h:73

Generated using doxygen 1.8.17