Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
SpCandidate.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_SPCANDIDATE_H
25 #define SKA_CHEETAH_DATA_SPCANDIDATE_H
26 
27 #include "cheetah/data/Units.h"
28 #include "cheetah/data/DedispersionMeasure.h"
29 #include "cheetah/utils/Architectures.h"
30 #include "panda/DataChunk.h"
31 #pragma GCC diagnostic push
32 #pragma GCC diagnostic ignored "-Wall"
33 #pragma GCC diagnostic ignored "-Wpragmas"
34 #pragma GCC diagnostic ignored "-Wunused-parameter"
35 #pragma GCC diagnostic ignored "-Wunused-variable"
36 #include <boost/units/quantity.hpp>
37 #include <boost/units/systems/si/time.hpp>
38 #include <boost/units/make_scaled_unit.hpp>
39 #pragma GCC diagnostic pop
40 #include <vector>
41 
42 namespace ska {
43 namespace cheetah {
44 namespace data {
45 
57 template <typename Arch, typename T>
58 class SpCandidate : public ska::panda::DataChunk<SpCandidate<Arch, T>>
59 {
60  public:
61  typedef T NumericalRep;
62  typedef DedispersionMeasureType<NumericalRep> Dm;
63  typedef boost::units::quantity<MilliSeconds, double> MsecTimeType;
64  typedef MsecTimeType Width;
65  typedef pss::astrotypes::units::ModifiedJulianClock::time_point TimePointType;
66  typedef T SigmaType;
67  typedef boost::units::quantity<MegaHertz, double> FrequencyType;
68 
69  public:
73  SpCandidate();
74 
83  SpCandidate(Dm dm, MsecTimeType tstart
84  , MsecTimeType width, T sigma
85  , std::size_t ident = 0 );
86 
96  SpCandidate(Dm dm, MsecTimeType tstart
97  , MsecTimeType width
98  , MsecTimeType tend
99  , T sigma
100  , std::size_t ident = 0 );
110  SpCandidate(Dm dm, MsecTimeType tstart
111  , MsecTimeType width
112  , T sigma
113  , FrequencyType low
114  , FrequencyType high
115  , std::size_t ident = 0 );
116 
120  ~SpCandidate();
121 
127  MsecTimeType const & tstart() const;
128 
134  void tstart(MsecTimeType c_tstart);
135 
141  MsecTimeType const& tend() const;
142  void tend(MsecTimeType);
143 
149  void duration_end(MsecTimeType c_tend);
150 
155  void dm_with_duration_end(FrequencyType const& f_high, FrequencyType const& f_low, Dm const& dm );
156 
168  Dm const & dm() const;
169 
170 
178  MsecTimeType const & width() const;
179 
187  void width(MsecTimeType c_width) ;
188 
201  T const & sigma() const;
202 
215  void sigma(T c_sigma) ;
216 
226  std::size_t const & ident() const;
227 
237  void ident(std::size_t c_ident) ;
238 
239  private:
240  Dm _dm;
241  MsecTimeType _tstart;
242  MsecTimeType _tend;
243  MsecTimeType _width;
244  T _sigma = 0.;
245  std::size_t _ident;
246 };
247 
248 
249 } // namespace data
250 } // namespace cheetah
251 } // namespace ska
252 
253 #include "cheetah/data/detail/SpCandidate.cpp"
254 
255 #endif // SKA_CHEETAH_DATA_SPCANDIDATE_H
A simple record to hold &#39;candidate&#39; proprerties.
Definition: SpCandidate.h:58
T const & sigma() const
access a reference to _sigma.
Dm const & dm() const
access a reference to dm.
SpCandidate()
Create a zero-sized SpCandidate.
Definition: SpCandidate.cpp:30
void dm_with_duration_end(FrequencyType const &f_high, FrequencyType const &f_low, Dm const &dm)
Set the end time : This step is important as the DM will be set along with the end time...
Some limits and constants for FLDO.
Definition: Brdz.h:35
MsecTimeType const & tstart() const
Get the start time of the candidate.
Definition: SpCandidate.cpp:74
std::size_t const & ident() const
access a reference to ident.
MsecTimeType const & width() const
access a reference to width.
void duration_end(MsecTimeType c_tend)
Set the end time The end time is calculated based on the DM of the candidate and the start and end f...
Definition: SpCandidate.cpp:98
MsecTimeType const & tend() const
Get the end time.
Definition: SpCandidate.cpp:86
~SpCandidate()
destroy a SpCandidate
Definition: SpCandidate.cpp:70