Index.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2006 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/General/Pulsar/Index.h
10 
11 #ifndef __Pulsar_Index_h
12 #define __Pulsar_Index_h
13 
14 #include <iostream>
15 
16 namespace Pulsar {
17 
19  class Index {
20 
21  public:
22 
24  Index (unsigned value = 0, bool integrate = false);
25 
27  unsigned get_value () const { return index; }
29  void set_value (unsigned value) { index = value; integrate = false; }
30 
32  bool get_integrate () const { return integrate; }
34  void set_integrate (bool flag = true) { integrate = flag; }
35 
37 
38  bool get_extension () const { return extension; }
40 
41  void set_extension (bool flag = true) { extension = flag; }
42 
43  protected:
44 
45  unsigned index;
46  bool integrate;
47  bool extension;
48  };
49 
50  std::ostream& operator << (std::ostream& os, const Index&);
51  std::istream& operator >> (std::istream& is, Index&);
52 
53  class Archive;
54  class Integration;
55 
57  const Integration*
58  get_Integration (const Archive* data, Index subint);
59 
60  class Profile;
61 
63  const Profile*
64  get_Profile (const Archive* data,
65  Index subint, Index pol, Index chan);
66 
67  const Profile*
68  get_Profile (const Integration* data, Index pol, Index chan);
69 
70  class PolnProfile;
71 
73 
74  const PolnProfile*
75  get_Stokes (const Archive* data, Index subint, Index chan);
76 
77  const PolnProfile*
78  get_Stokes (const Integration* data, Index chan);
79 }
80 
81 #endif
void set_value(unsigned value)
Set the value of the index.
Definition: Index.h:39
const PolnProfile * get_Stokes(const Archive *data, Index subint, Index chan)
Return a new PolnProfile with state == Signal::Stokes.
Definition: Index.C:158
Combines an index value and integrate flag.
Definition: Index.h:24
void set_integrate(bool flag=true)
Set the integrate flag.
Definition: Index.h:44
bool get_extension() const
Get the extension flag.
Definition: Index.h:48
const Integration * get_Integration(const Archive *data, Index subint)
Return the requested profile, cloning and integrating when needed.
Definition: Index.C:118
Any quantity recorded as a function of pulse phase.
Definition: Profile.h:45
The primary interface to pulsar observational data.
Definition: Archive.h:45
bool get_integrate() const
Get the integrate flag.
Definition: Index.h:42
Type * release()
Type * get() const
void set_extension(bool flag=true)
Set the extension flag.
Definition: Index.h:51
Array of Profiles integrated over the same time interval.
Definition: Integration.h:37
Polarimetric pulse profile transformations and derivations.
Definition: PolnProfile.h:34
Defines the PSRCHIVE library.
Definition: CalSource.h:17
const Profile * get_Profile(const Archive *data, Index subint, Index pol, Index chan)
Return the requested profile, cloning and integrating when needed.
Definition: Index.C:24
unsigned get_value() const
Get the value of the index.
Definition: Index.h:37
Index(unsigned value=0, bool integrate=false)
Default constructor.
Definition: Index.C:16

Generated using doxygen 1.8.17