ArchiveComparisons.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2021 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/More/General/Pulsar/ArchiveComparisons.h
10
11#ifndef __ArchiveComparisons_h
12#define __ArchiveComparisons_h
13
14#include "Pulsar/ArchiveStatistic.h"
15#include "Pulsar/ScrunchFactor.h"
16
17#include "ndArray.h"
18
19class BinaryStatistic;
20class UnaryStatistic;
21
22namespace Pulsar {
23
24 class CompareWith;
25
26 class ArchiveComparisons : public Identifiable::Proxy<ArchiveStatistic>
27 {
28
29 public:
30
31 ArchiveComparisons (BinaryStatistic*);
32
33 void set_Archive (const Archive*);
34
35 double get ();
36
37 class Interface;
38
39 TextInterface::Parser* get_interface ();
40
41 ArchiveComparisons* clone () const;
42
43 const std::string& get_what () const { return what; }
44 void set_what (const std::string& t) { what = t; }
45
46 const std::string& get_way () const { return way; }
47 void set_way (const std::string& t) { way = t; }
48
50 void set_compute_subint (const std::vector<bool>& flags)
51 { compute_subint = flags; }
52
54 void set_compute_chan (const std::vector<bool>& flags)
55 { compute_chan = flags; }
56
58 void set_bscrunch (const ScrunchFactor& f);
59
61 const ScrunchFactor get_bscrunch () const { return bscrunch_factor; }
62
64 void set_setup_Archive (const Archive*);
65
67 /* Not all archive comparisons require a global set up */
68 bool get_setup ();
69
70 protected:
71
73 Reference::To<CompareWith> compare;
74
76 Reference::To<BinaryStatistic> stat;
77
79 ndArray<2,double> result;
80
82 std::vector<bool> compute_subint;
83
85 std::vector<bool> compute_chan;
86
88 ScrunchFactor bscrunch_factor;
89
90 // what to compare
91 std::string what;
92 // dimension along which to compare
93 std::string way;
94
95 void build ();
96 bool built;
97
98 void build_compare ();
99 void init_compare (const Archive* arch);
100 };
101
102}
103
104#endif
105
Loops over two dimensions of an Archive, comparing profiles.
Definition CompareWith.h:29
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0