TimerIntegration.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// psrchive/Base/Formats/Timer/Pulsar/TimerIntegration.h
10
11/*
12
13 Pulsar::Integration - base class for pulsar observations
14
15*/
16
17#ifndef __Timer_Integration_h
18#define __Timer_Integration_h
19
20#include <stdio.h>
21#include <vector>
22
23#include "Pulsar/Integration.h"
24#include "mini.h"
25
26namespace Pulsar {
27
28 class TimerIntegration : public Integration {
29
30 public:
31
32 friend class TimerArchive;
33
35 TimerIntegration ();
36
38 TimerIntegration (const TimerIntegration& t_subint);
39
41 TimerIntegration (const Integration& subint);
42
44 virtual ~TimerIntegration ();
45
47 virtual void copy (const Integration* subint, bool management = true);
48
50 virtual Integration* clone () const;
51
53
54 virtual unsigned get_nchan () const { return nchan; }
55
57
58 virtual unsigned get_npol () const { return npol; }
59
61
62 virtual unsigned get_nbin () const { return nbin; }
63
65 virtual MJD get_epoch () const;
67 virtual void set_epoch (const MJD& mjd);
68
70 virtual double get_duration () const;
72 virtual void set_duration (double seconds);
73
75 virtual double get_folding_period () const;
77 virtual void set_folding_period (double seconds);
78
80 void load (FILE * fptr, int wts_and_bpass, bool big_endian=true);
81
83 void unload (FILE * fptr) const;
84
86 virtual void resize (unsigned npol, unsigned nchan, unsigned nbin);
87
89 virtual void insert (Integration*);
90
91 protected:
92
93 struct mini mini;
94
96 unsigned npol;
97
99 unsigned nchan;
100
102 unsigned nbin;
103
105 std::vector<float> wts;
106
108 std::vector< std::vector<float> > med;
109
111 std::vector< std::vector<float> > bpass;
112
114
115 virtual void set_nbin (unsigned numbins) { nbin = numbins; }
116
118
119 virtual void set_nchan (unsigned numchan) { nchan = numchan; }
120
122
123 virtual void set_npol (unsigned numpol) { npol = numpol; }
124
126 void init ();
127
129 void load_extra (FILE* fptr, bool big_endian);
130
132 void load_old (FILE* fptr, bool big_endian);
133
135 void unpack_Pointing ();
136
138 void pack_Pointing () const;
139
140 };
141
143 void TimerProfile_load (FILE* fptr, Profile* profile, bool big_endian=true);
144
146 void TimerProfile_unload (FILE* fptr, const Profile* profile, int poln);
147
148}
149
150#endif
Array of Profiles integrated over the same time interval.
Definition Integration.h:37
virtual unsigned get_nbin() const =0
Get the number of bins in each profile.
virtual MJD get_epoch() const =0
Get the epoch of the rising edge of bin zero.
virtual unsigned get_nchan() const =0
Get the number of chans.
virtual double get_folding_period() const =0
Get the folding or topocentric pulsar period (in seconds)
virtual double get_duration() const =0
Get the total time integrated (in seconds)
virtual unsigned get_npol() const =0
Get the number of polarization measurements.
virtual Integration * clone() const =0
Return a new copy of self.
Integration()
Default constructor.
Definition Integration.C:158
Any quantity recorded as a function of pulse phase.
Definition Profile.h:40
Defines the PSRCHIVE library.
Definition CalSource.h:17
void TimerProfile_unload(FILE *fptr, const Profile *profile, int poln)
unload a Profile to a timer archive
Definition TimerProfile_unload.C:26
void TimerProfile_load(FILE *fptr, Profile *profile, bool big_endian=true)
load a Profile from a timer archive
Definition TimerProfile_load.C:22

Generated using doxygen 1.14.0