EPOSArchive.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 /* $Source: /cvsroot/psrchive/psrchive/Base/Classes/Pulsar/EPOSArchive.h,v $
10  $Revision: 1.13 $
11  $Date: 2008/11/07 22:15:36 $
12  $Author: straten $ */
13 
14 #ifndef __EPOSArchive_h
15 #define __EPOSArchive_h
16 
17 #include "Pulsar/BasicArchive.h"
18 #include "Pulsar/Agent.h"
19 #include "eposio.h"
20 
21 namespace Pulsar {
22 
24 
29  class EPOSArchive : public BasicArchive {
30 
31  public:
32 
35 
37  EPOSArchive (const EPOSArchive& archive);
38 
40  ~EPOSArchive ();
41 
43  const EPOSArchive& operator = (const EPOSArchive& archive);
44 
46  EPOSArchive (const Archive& archive);
47 
49  void copy (const Archive& archive);
50 
52  EPOSArchive* clone () const;
53 
54 
55  protected:
56 
58  virtual void load_header (const char* filename);
59 
60  virtual Integration* new_Integration (const Integration* copy_this = 0);
61 
63  virtual Integration*
64  load_Integration (const char* filename, unsigned subint);
65 
67  bool can_unload () const { return false; }
68 
70  virtual void unload_file (const char* filename) const;
71 
72  // Advocates the use of the EPOSArchive plugin
73  class Agent;
74 
76  friend class Archive::Advocate<EPOSArchive>;
77 
78  // local variables specific to EPOS archive
79 
80  unsigned int current_record;
81 
82  unsigned long ref_syncusec;
83 
84  eposhdr_t eposhdr;
85 
86  eposdata_t eposdata;
87 
88 
89  private:
90 
92  void init ();
93 
95  std::string get_source (eposhdr_t *eposhdr);
96 
97  MJD get_startdate(const char *filename, eposhdr_t *eposhdr, unsigned subint);
98 
99  double get_intlen (eposhdr_t *eposhdr);
100 
101  double get_foldperiod (eposhdr_t *eposhdr);
102 
103  };
104 
105 
106  // Advocates the use of the EPOSArchive plugin
107  class EPOSArchive::Agent : public Archive::Advocate<EPOSArchive> {
108 
109  public:
110 
111  Agent () { }
112 
114  bool advocate (const char* filename);
115 
117  std::string get_name () { return "EPOS"; }
118 
120  std::string get_description () ;
121 
122  };
123 
124 }
125 
126 #endif
Loads and unloads EPOS Pulsar archives.
Definition: EPOSArchive.h:34
virtual void load_header(const char *filename)
Load the EPOS header information from filename.
Definition: EPOSArchive.C:195
EPOSArchive * clone() const
Return a new copy-constructed EPOSArchive instance.
Definition: EPOSArchive.C:87
virtual void unload_file(const char *filename) const
Unload the EPOSArchive (header and Integration data) to filename.
Definition: EPOSArchive.C:317
bool can_unload() const
The unload_file method is not implemented.
Definition: EPOSArchive.h:77
EPOSArchive()
Default constructor.
Definition: EPOSArchive.C:30
void set_amps(const T *data)
set the amplitudes array equal to the contents of the data array
Definition: ProfileAmps.h:89
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
virtual std::string get_source() const
Get the source name.
Definition: BasicArchive.C:155
virtual Integration * load_Integration(const char *filename, unsigned subint)
Load the specified Integration from filename, returning new instance.
Definition: EPOSArchive.C:247
void copy(const Archive &archive)
Copy all of the class attributes and the selected Integration data.
Definition: EPOSArchive.C:61
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
virtual void set_folding_period(double seconds)
Set the folding period (in seconds)
Definition: BasicIntegration.h:73
~EPOSArchive()
Destructor.
Definition: EPOSArchive.C:38
const EPOSArchive & operator=(const EPOSArchive &archive)
Assignment operator.
Defines the PSRCHIVE library.
Definition: CalSource.h:17
virtual Integration * new_Integration(const Integration *copy_this=0)
Return a pointer to a new BasicIntegration.
Definition: EPOSArchive.C:176
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

Generated using doxygen 1.8.17