Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
GeneratorAppConfig.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_GENERATOR_GENERATORAPPCONFIG_H
25 #define SKA_CHEETAH_GENERATOR_GENERATORAPPCONFIG_H
26 
27 #include "panda/BasicAppConfig.h"
28 #include "cheetah/generators/Config.h"
29 #include "cheetah/sigproc/WriterConfig.h"
30 #include "cheetah/data/Units.h"
31 #include <string>
32 #include <vector>
33 
34 namespace ska {
35 namespace cheetah {
36 namespace generators {
37 
46 class GeneratorAppConfig : public ska::panda::BasicAppConfig
47 {
48  typedef boost::units::quantity<data::MegaHertz, double> FrequencyType;
49  typedef boost::units::quantity<boost::units::si::time, double> IntervalType;
50 
51  public:
52  GeneratorAppConfig(std::string const& app_name, std::string const& description);
54 
58  void set_generator_list(std::vector<std::string> const& generator_names);
59 
63  std::vector<std::string> const& generator_list() const;
64 
69 
74 
78  std::size_t number_of_chunks() const;
79 
83  std::size_t number_of_time_samples() const;
84 
88  std::size_t number_of_channels() const;
89 
93  std::vector<std::string> const& data_generator() const;
94 
98  FrequencyType start_frequency() const;
99 
103  FrequencyType channel_width() const;
104 
108  IntervalType sample_interval() const;
109 
110 
111  protected:
112  std::string version() const override;
113 
114  protected:
115  void add_options(OptionsDescriptionEasyInit& add_options) override;
116 
117  private:
118  ska::cheetah::generators::Config _generator_config;
119  sigproc::WriterConfig _sigproc_config;
120  std::vector<std::string> _generator_keys;
121  std::size_t _number_of_chunks;
122  std::size_t _number_of_channels;
123  std::size_t _number_of_time_samples;
124  std::vector<std::string> _generator_selected;
125  FrequencyType _frequency;
126  FrequencyType _channel_width;
127  IntervalType _sample_interval;
128 };
129 
130 
131 } // namespace generators
132 } // namespace cheetah
133 } // namespace ska
134 
135 #endif // SKA_CHEETAH_GENERATOR_GENERATORAPPCONFIG_H
std::vector< std::string > const & generator_list() const
list the known generators
void set_generator_list(std::vector< std::string > const &generator_names)
set the known generators
ska::cheetah::generators::Config & generator_config()
return the generator configuration object
Generator Configuration file.
Definition: Config.h:46
FrequencyType channel_width() const
return the channel width (homgenous cwidth channels)
Configuration options for a SigProcWriter.
Definition: WriterConfig.h:41
std::vector< std::string > const & data_generator() const
return the chosen data model
Some limits and constants for FLDO.
Definition: Brdz.h:35
sigproc::WriterConfig const & sigproc_config() const
return the configuration object for directing sigproc writer
Top level configuration for the generator app.
std::size_t number_of_time_samples() const
return the number of time smaples per data chunk
IntervalType sample_interval() const
sample interval (in seconds)
FrequencyType start_frequency() const
return the start frequency
std::size_t number_of_chunks() const
return the number of data chunks to produce for the data file
std::size_t number_of_channels() const
return the number of channels for each data chunk