ASPArchive.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2007 by Paul Demorest
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/Base/Formats/ASP/Pulsar/ASPArchive.h
10
11#ifndef __ASPArchive_h
12#define __ASPArchive_h
13
14#include "Pulsar/BasicArchive.h"
15#include "Pulsar/Agent.h"
16#include <fitsio.h>
17
18// File version codes
19#define ASP_FITS_V10 1
20#define ASP_FITS_V11 2
21#define ASP_FITS_V101 3
22
23namespace Pulsar {
24
26 class ASPArchive : public BasicArchive {
27
28 public:
29
31 ASPArchive ();
32
34 ASPArchive (const ASPArchive& archive);
35
37 ~ASPArchive ();
38
40 const ASPArchive& operator = (const ASPArchive& archive);
41
43 ASPArchive (const Archive& archive);
44
46 void copy (const Archive& archive);
47
49 ASPArchive* clone () const;
50
51 protected:
52
54 virtual void load_header (const char* filename);
55
57 virtual Integration*
58 load_Integration (const char* filename, unsigned subint);
59
61 void load_extensions(fitsfile *f, int *status);
62
64 bool can_unload () const { return false; }
65
67 virtual void unload_file (const char* filename) const;
68
69 // Advocates the use of the ASPArchive plugin
70 class Agent;
71
73 friend class Archive::Advocate<ASPArchive>;
74
75 private:
76
78 void init ();
79
81 int asp_file_version;
82
84 bool have_asp_stokes;
85
86 };
87
88
89 // Advocates the use of the ASPArchive plugin
90 class ASPArchive::Agent : public Archive::Advocate<ASPArchive> {
91
92 public:
93
94 Agent () { }
95
97 bool advocate (const char* filename);
98
100 std::string get_name () { return "ASP"; }
101
103 std::string get_description ();
104
105 };
106
107}
108
109#endif
const ASPArchive & operator=(const ASPArchive &archive)
Assignment operator.
virtual void unload_file(const char *filename) const
Unload the ASPArchive (header and Integration data) to filename.
Definition ASPArchive.C:599
ASPArchive * clone() const
Return a new copy-constructed ASPArchive instance.
Definition ASPArchive.C:95
ASPArchive()
Default constructor.
Definition ASPArchive.C:43
virtual void load_header(const char *filename)
Load the ASP header information from filename.
Definition ASPArchive.C:102
~ASPArchive()
Destructor.
Definition ASPArchive.C:48
bool can_unload() const
The unload_file method is not implemented.
Definition ASPArchive.h:64
virtual Integration * load_Integration(const char *filename, unsigned subint)
Load the specified Integration from filename, returning new instance.
Definition ASPArchive.C:302
void load_extensions(fitsfile *f, int *status)
Fill in info for select Archive extensions.
Definition ASPArchive.C:509
void copy(const Archive &archive)
Copy all of the class attributes and the selected Integration data.
Definition ASPArchive.C:71
The primary interface to pulsar observational data.
Definition Archive.h:46
BasicArchive()
null constructor
Definition BasicArchive.C:18
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