Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
Candidate.h
1 /*
2  * The MIT License (MIT)
3  *
4  * Copyright (c) 2016 The SKA organisation
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24 #ifndef SKA_CHEETAH_DATA_CANDIDATE_H
25 #define SKA_CHEETAH_DATA_CANDIDATE_H
26 
27 #include <vector>
28 #include "panda/DataChunk.h"
29 #include "cheetah/data/Units.h"
30 #include "cheetah/data/DedispersionMeasure.h"
31 #include "cheetah/utils/Architectures.h"
32 #pragma GCC diagnostic push
33 #pragma GCC diagnostic ignored "-Wall"
34 #pragma GCC diagnostic ignored "-Wpragmas"
35 #pragma GCC diagnostic ignored "-Wunused-parameter"
36 #pragma GCC diagnostic ignored "-Wunused-variable"
37 #include <boost/units/quantity.hpp>
38 #include <boost/units/systems/si/time.hpp>
39 #include <boost/units/make_scaled_unit.hpp>
40 #pragma GCC diagnostic pop
41 
42 namespace ska {
43 namespace cheetah {
44 namespace data {
45 
59 template <typename Arch, typename T>
60 class Candidate : public ska::panda::DataChunk<Candidate<Arch, T>>
61 {
62  public:
63  typedef DedispersionMeasureType<T> Dm;
64  typedef boost::units::quantity<MilliSeconds, double> MsecTimeType;
65  typedef MsecTimeType TimeType;
66  typedef boost::units::quantity<boost::units::si::dimensionless, T> SecPerSecType;
67 
68  public:
69  // public methods
73  Candidate();
74 
82  Candidate(MsecTimeType pulse_period, SecPerSecType pulse_pdot, Dm dm, std::size_t ident = 0 );
83 
93  Candidate(MsecTimeType pulse_period, SecPerSecType pulse_pdot, Dm dm, MsecTimeType pulse_width, T sigma, std::size_t ident = 0);
94 
98  ~Candidate();
99 
105  MsecTimeType const & period() const;
106 
112  void period(MsecTimeType c_period);
113 
124  SecPerSecType const & pdot() const;
125 
136  void pdot(SecPerSecType c_pulse_pdot);
137 
149  Dm const & dm() const;
150 
162  void dm(Dm c_dm) ;
163 
173  MsecTimeType const & width() const;
174 
184  void width(MsecTimeType c_width) ;
185 
198  T const & sigma() const;
199 
212  void sigma(T c_sigma) ;
213 
223  std::size_t const & ident() const;
224 
234  void ident(std::size_t c_ident) ;
235 
236  private:
237  MsecTimeType _pulse_period ;
238  SecPerSecType _pulse_pdot = 0. ;
239  Dm _dm;
240  MsecTimeType _pulse_width ;
241  T _sigma = 0. ;
242  std::size_t _ident;
243 };
244 
245 
246 } // namespace data
247 } // namespace cheetah
248 } // namespace ska
249 
250 #include "cheetah/data/detail/Candidate.cpp"
251 
252 #endif // SKA_CHEETAH_DATA_CANDIDATE_H
SecPerSecType const & pdot() const
access a reference to pulse_pdot.
Definition: Candidate.cpp:73
Candidate()
Create a zero-sized Candidate.
Definition: Candidate.cpp:30
T const & sigma() const
access a reference to _sigma.
Definition: Candidate.cpp:111
Some limits and constants for FLDO.
Definition: Brdz.h:35
MsecTimeType const & width() const
access a reference to width.
Definition: Candidate.cpp:98
~Candidate()
destroy a Candidate
Definition: Candidate.cpp:57
std::size_t const & ident() const
access a reference to ident.
Definition: Candidate.cpp:123
A simple record to hold &#39;candidate&#39; proprerties.
Definition: Candidate.h:60
Dm const & dm() const
access a reference to dm.
Definition: Candidate.cpp:85
MsecTimeType const & period() const
access a reference to pulsar period.
Definition: Candidate.cpp:61