Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
PulsarInjection.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_GENERATORS_PULSARINJECTIION_H
25 #define SKA_CHEETAH_GENERATORS_PULSARINJECTIION_H
26 
27 #include "TimeFrequencyGenerator.h"
28 #include "PulsarInjectionConfig.h"
29 #include "pulse_profile/PulsarProfile.h"
30 #include <complex>
31 #include <cmath>
32 #include <cstdlib>
33 #include <cstdio>
34 #include <string.h>
35 #include <stdbool.h>
36 #include <iostream>
37 #include <numeric>
38 #include <functional>
39 
40 namespace ska {
41 namespace cheetah {
42 namespace generators {
43 class ProfileManager;
52 template<typename T>
54 {
56  typedef typename BaseT::DataType DataType;
57 
58  public:
59  PulsarInjection(PulsarInjectionConfig const&, ProfileManager const& profile_manager);
60  ~PulsarInjection();
61 
62  virtual void next(DataType& data) override;
63 
64  private:
65  PulsarInjectionConfig const& _config;
66  ProfileManager const& _profile_manager;
67  PulsarProfile _profile;
68  std::function<double(utils::ModifiedJulianClock::time_point const&, boost::units::quantity<data::MegaHertz, double>)> _phase_model;
69  std::size_t _last_number_of_channels;
70  std::size_t _last_number_of_spectra;
71 };
72 
73 
74 } // namespace generators
75 } // namespace cheetah
76 } // namespace ska
77 #include "detail/PulsarInjection.cpp"
78 
79 #endif // SKA_CHEETAH_GENERATORS_PULSARINJECTIION_H
80 
Add a pulsar profile into the existing data.
An API for accessing pulsar pulse profiles.
A simple intensity profile representing a pulse shape.
Definition: PulsarProfile.h:43
Some limits and constants for FLDO.
Definition: Brdz.h:35
Confgiuration Parameters for the pulsar injection generator.