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
21namespace Pulsar {
22
24
29 class EPOSArchive : public BasicArchive {
30
31 public:
32
34 EPOSArchive ();
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
The primary interface to pulsar observational data.
Definition Archive.h:46
virtual std::string get_source() const
Get the source name.
Definition BasicArchive.C:155
BasicArchive()
null constructor
Definition BasicArchive.C:18
EPOSArchive * clone() const
Return a new copy-constructed EPOSArchive instance.
Definition EPOSArchive.C:87
virtual Integration * new_Integration(const Integration *copy_this=0)
Return a pointer to a new BasicIntegration.
Definition EPOSArchive.C:176
const EPOSArchive & operator=(const EPOSArchive &archive)
Assignment operator.
virtual void load_header(const char *filename)
Load the EPOS header information from filename.
Definition EPOSArchive.C:195
bool can_unload() const
The unload_file method is not implemented.
Definition EPOSArchive.h:67
virtual Integration * load_Integration(const char *filename, unsigned subint)
Load the specified Integration from filename, returning new instance.
Definition EPOSArchive.C:247
~EPOSArchive()
Destructor.
Definition EPOSArchive.C:38
void copy(const Archive &archive)
Copy all of the class attributes and the selected Integration data.
Definition EPOSArchive.C:61
EPOSArchive()
Default constructor.
Definition EPOSArchive.C:30
virtual void unload_file(const char *filename) const
Unload the EPOSArchive (header and Integration data) to filename.
Definition EPOSArchive.C:317
Array of Profiles integrated over the same time interval.
Definition Integration.h:37
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0