BPPArchive.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#ifndef __BPPArchive_h
10#define __BPPArchive_h
11
12#include "Pulsar/BasicArchive.h"
13#include "Pulsar/Agent.h"
14
15// BPP header struct
16#include <bpp_header.h>
17
18namespace Pulsar {
19
21
24 class BPPArchive : public BasicArchive {
25
26 public:
27
29 BPPArchive ();
30
32 BPPArchive (const BPPArchive& archive);
33
35 ~BPPArchive ();
36
38 const BPPArchive& operator = (const BPPArchive& archive);
39
41 BPPArchive (const Archive& archive);
42
44 void copy (const Archive& archive);
45
47 BPPArchive* clone () const;
48
50
54 enum Linearization { Mean, Bins, None };
55
56 protected:
57
59 void fix_orig_rfs();
60
62 void hdr_to_big_endian ();
63
65 virtual void load_header (const char* filename);
66
68 int get_mjd_from_hdr();
69
72
74 int linearize_power(float quant_power, float *input_power, float *gain,
75 float *xgain);
76
78 virtual Integration*
79 load_Integration (const char* filename, unsigned subint);
80
82 void load_extensions();
83
85 bool can_unload () const { return false; }
86
88 virtual void unload_file (const char* filename) const;
89
90 // Advocates the use of the BPPArchive plugin
91 class Agent;
92
94 friend class Archive::Advocate<BPPArchive>;
95
96 private:
97
99 bpp_header hdr;
100
103 double *orig_rfs;
104 int orig_rfs_corrected;
105
107 void init ();
108
109 };
110
111
112 // Advocates the use of the BPPArchive plugin
113 class BPPArchive::Agent : public Archive::Advocate<BPPArchive> {
114
115 public:
116
117 Agent () { }
118
120 bool advocate (const char* filename);
121
123 std::string get_name () { return "BPP"; }
124
126 std::string get_description ();
127
128 };
129
130
131}
132
133#endif
The primary interface to pulsar observational data.
Definition Archive.h:46
Linearization lin_method
Selected linearization method.
Definition BPPArchive.h:71
~BPPArchive()
Destructor.
Definition BPPArchive.C:46
Linearization
Different linearization methods.
Definition BPPArchive.h:54
void load_extensions()
Fill in Archive extension info.
Definition BPPArchive.C:610
bool can_unload() const
The unload_file method is not implemented.
Definition BPPArchive.h:85
void hdr_to_big_endian()
Convert raw header data to big endian.
Definition BPPArchive.C:155
BPPArchive()
Default constructor.
Definition BPPArchive.C:41
BPPArchive * clone() const
Return a new copy-constructed BPPArchive instance.
Definition BPPArchive.C:94
virtual void unload_file(const char *filename) const
Unload the BPPArchive (header and Integration data) to filename.
Definition BPPArchive.C:657
virtual void load_header(const char *filename)
Load the BPP header information from filename.
Definition BPPArchive.C:190
void fix_orig_rfs()
Correct the RFs array from the file.
Definition BPPArchive.C:124
const BPPArchive & operator=(const BPPArchive &archive)
Assignment operator.
virtual Integration * load_Integration(const char *filename, unsigned subint)
Load the specified Integration from filename, returning new instance.
Definition BPPArchive.C:406
int get_mjd_from_hdr()
Get integer MJD out of the BPP header.
Definition BPPArchive.C:343
int linearize_power(float quant_power, float *input_power, float *gain, float *xgain)
Linearize 2-bit power scale.
Definition BPPArchive.C:369
void copy(const Archive &archive)
Copy all of the class attributes and the selected Integration data.
Definition BPPArchive.C:71
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