Commit bdbbcc0bfb71d26e6fab0bde33b51de8253e02b4
Exists in
master
and in
24 other branches
Merge branch 'FER_10412' into amdadev
Showing
11 changed files
with
688 additions
and
0 deletions
Show diff stats
CMakeLists.txt
... | ... | @@ -78,6 +78,7 @@ find_package(Geopack REQUIRED) |
78 | 78 | find_package(Maglib REQUIRED) |
79 | 79 | find_package(InternalField REQUIRED) |
80 | 80 | find_package(Con2020 REQUIRED) |
81 | +find_package(KT17 REQUIRED) | |
81 | 82 | find_package(Cainlib REQUIRED) |
82 | 83 | find_package(CSlim) |
83 | 84 | |
... | ... | @@ -187,6 +188,7 @@ add_subdirectory(src/ExternLib/vector_) |
187 | 188 | add_subdirectory(src/ExternLib/DataFiltering) |
188 | 189 | add_subdirectory(src/ExternLib/Spectrum) |
189 | 190 | add_subdirectory(src/ExternLib/InternalField) |
191 | +add_subdirectory(src/ExternLib/KT17) | |
190 | 192 | add_subdirectory(src/ExternLib/Timestamp) |
191 | 193 | add_subdirectory(src/ExternLib/Tetrahedron/elongation) |
192 | 194 | add_subdirectory(src/ExternLib/Tetrahedron/planarity) | ... | ... |
... | ... | @@ -0,0 +1,23 @@ |
1 | +FIND_PATH(KT17INCLUDE_DIR libkt.h | |
2 | + HINTS | |
3 | + ${USERLOCAL_ROOT}/include | |
4 | + NO_DEFAULT_PATH | |
5 | +) | |
6 | +mark_as_advanced(KT17INCLUDE_DIR) | |
7 | + | |
8 | +find_library(KT17LIBRARY | |
9 | + NAMES kt | |
10 | + HINTS | |
11 | + ${USERLOCAL_ROOT}/lib | |
12 | + NO_DEFAULT_PATH | |
13 | +) | |
14 | +mark_as_advanced(KT17LIBRARY) | |
15 | + | |
16 | +include(FindPackageHandleStandardArgs) | |
17 | +FIND_PACKAGE_HANDLE_STANDARD_ARGS(KT17 DEFAULT_MSG KT17LIBRARY KT17INCLUDE_DIR) | |
18 | + | |
19 | +if(KT17_FOUND) | |
20 | + set(KT17INCLUDE_DIRS ${KT17INCLUDE_DIR}) | |
21 | + set(KT17LIBRARIES ${KT17LIBRARY}) | |
22 | +endif() | |
23 | + | ... | ... |
src/Common/AMDA_constants.hh
... | ... | @@ -8,9 +8,16 @@ |
8 | 8 | #ifndef AMDA_CONSTANTS_HH_ |
9 | 9 | #define AMDA_CONSTANTS_HH_ |
10 | 10 | |
11 | +// Gravitational constant | |
12 | +#define GV 6.674e-11 | |
13 | + | |
14 | +// SUN | |
15 | +#define M_SUN 1.989e30 | |
16 | + | |
11 | 17 | // all radii in km |
12 | 18 | #define ASTRONOMICAL_UNIT 149598000. |
13 | 19 | #define RADIUS_MERCURY 2440. |
20 | +#define SEMIMAJOR_MERCURY 57.91e6 | |
14 | 21 | #define RADIUS_VENUS 6052. |
15 | 22 | #define RADIUS_EARTH 6371. |
16 | 23 | #define RADIUS_MARS 3396. | ... | ... |
... | ... | @@ -0,0 +1,34 @@ |
1 | +/* | |
2 | + * To change this license header, choose License Headers in Project Properties. | |
3 | + * To change this template file, choose Tools | Templates | |
4 | + * and open the template in the editor. | |
5 | + */ | |
6 | +#include "ServicesServer.hh" | |
7 | +#include "PluginManager.hh" | |
8 | + | |
9 | +#include "KT17_CartProcess.hh" | |
10 | +#include "KT17_MagProcess.hh" | |
11 | + | |
12 | +using namespace AMDA::Parameters; | |
13 | + | |
14 | +/** | |
15 | + Retrieve the Plugin version we're going to expect | |
16 | + */ | |
17 | +extern "C" const char *getPluginVersion() | |
18 | +{ | |
19 | + return "(Version)"; | |
20 | +} | |
21 | + | |
22 | +/** | |
23 | + Tells us to register our functionality to an engine kernel | |
24 | + */ | |
25 | +extern "C" void registerPlugin(AMDA::Plugins::PluginManager &pm) | |
26 | +{ | |
27 | + ProcessFactory factKT17_CartProcess = boost::factory<KT17_CartProcess *>(); | |
28 | + ServicesServer::getInstance()->addProcessFactory("KT17_cart", factKT17_CartProcess); | |
29 | + ServicesServer::getInstance()->linkProcessWithPlugin("KT17_cart", pm.getCurrentPluginPath()); | |
30 | + | |
31 | + ProcessFactory factKT17_MagProcess = boost::factory<KT17_MagProcess *>(); | |
32 | + ServicesServer::getInstance()->addProcessFactory("KT17_mag", factKT17_MagProcess); | |
33 | + ServicesServer::getInstance()->linkProcessWithPlugin("KT17_mag", pm.getCurrentPluginPath()); | |
34 | +} | ... | ... |
... | ... | @@ -0,0 +1,39 @@ |
1 | + | |
2 | +PROJECT(kt17) | |
3 | + | |
4 | +set(LIBRARY_OUTPUT_PATH ${PLUGIN_OUTPUT_PATH}) | |
5 | + | |
6 | +include_directories( | |
7 | + ${CMAKE_HOME_DIRECTORY}/src/InternLib/ | |
8 | + ${CMAKE_HOME_DIRECTORY}/src/Common/ | |
9 | + ${CMAKE_HOME_DIRECTORY}/src/Parameters/ | |
10 | + ${CMAKE_HOME_DIRECTORY}/src/Plugins/ | |
11 | + ${CMAKE_HOME_DIRECTORY}/src/helpers/ | |
12 | + ${CMAKE_HOME_DIRECTORY}/src/TimeTableCatalog/ | |
13 | + ${CMAKE_HOME_DIRECTORY}/src/Info/ | |
14 | + ${LOG4CXX_INCLUDE_DIR} | |
15 | + ${Boost_INCLUDE_DIR} | |
16 | + ${KT17INCLUDE_DIRS} | |
17 | +) | |
18 | + | |
19 | +#Library configuration | |
20 | +file( | |
21 | + GLOB_RECURSE | |
22 | + source_files | |
23 | + ./* | |
24 | +) | |
25 | + | |
26 | +ADD_LIBRARY( kt17Process SHARED ${source_files} ) | |
27 | + | |
28 | + | |
29 | +target_link_libraries( | |
30 | + kt17Process | |
31 | + ${LOG4CXX_LIBRARIES} | |
32 | + ${KT17LIBRARIES} | |
33 | + Parameters | |
34 | + InternLib | |
35 | + TimeTableCatalog | |
36 | + TimeUtil | |
37 | + Info | |
38 | +) | |
39 | + | ... | ... |
... | ... | @@ -0,0 +1,146 @@ |
1 | +/* | |
2 | + * File: KT17.hh | |
3 | + * Author: Furkan - AKKA I&S | |
4 | + * | |
5 | + * Created on January 19, 2022, 4:14 PM | |
6 | + */ | |
7 | +#ifndef KT17_HH | |
8 | +#define KT17_HH | |
9 | + | |
10 | +#include "libkt.h" // If we name it this way | |
11 | + | |
12 | +#include "Parameter.hh" | |
13 | +#include "ParamData.hh" | |
14 | +#include "DataTypeMath.hh" | |
15 | +#include "Operation.hh" | |
16 | +#include <vector> | |
17 | + | |
18 | +using namespace std; | |
19 | + | |
20 | +namespace AMDA | |
21 | +{ | |
22 | + namespace Parameters | |
23 | + { | |
24 | + template <typename DataType, class TOutputParamData> | |
25 | + class KT17 : public Operation | |
26 | + { | |
27 | + public: | |
28 | + KT17(Process &pProcess, ParamDataSpec<vector<DataType>> ¶mInput, string coordRef, double rSun, double distIndex) | |
29 | + : Operation(pProcess), _paramInput(paramInput), _coordRef(coordRef), _rSun(rSun), _distIndex(distIndex), | |
30 | + _paramOutput(new TOutputParamData()) | |
31 | + { | |
32 | + _paramDataOutput = _paramOutput; | |
33 | + } | |
34 | + | |
35 | + virtual ~KT17() | |
36 | + { | |
37 | + } | |
38 | + void write(ParamDataIndexInfo &pParamDataIndexInfo) | |
39 | + { | |
40 | + for (unsigned int _index = pParamDataIndexInfo._startIndex; | |
41 | + _index < pParamDataIndexInfo._startIndex + pParamDataIndexInfo._nbDataToProcess; | |
42 | + ++_index) | |
43 | + { | |
44 | + vector<DataType> in = _paramInput.getDataList()[_index]; | |
45 | + if (in[0] == 0) | |
46 | + in[0] = 1e-31; | |
47 | + double crtTime = _paramInput.getTime(_index); | |
48 | + vector<DataType> outputBxyz; | |
49 | + outputBxyz.resize(3); | |
50 | + DataType outputBm; | |
51 | + | |
52 | + /* Creation of the output vectors */ | |
53 | + GetModelField(in,outputBxyz); | |
54 | + | |
55 | + outputBm = sqrt(outputBxyz[0] * outputBxyz[0] + outputBxyz[1] * outputBxyz[1] + outputBxyz[2] * outputBxyz[2]); | |
56 | + | |
57 | + _paramOutput->pushTime(crtTime); | |
58 | + pushResult(outputBxyz, outputBm); | |
59 | + } | |
60 | + } | |
61 | + int GetModelField(vector<DataType> &input, vector<DataType> &output){ | |
62 | + double Bx, By, Bz; | |
63 | + double x,y,z; | |
64 | + double* params=new double[2]; | |
65 | + double dz = 0.196; | |
66 | + | |
67 | + | |
68 | + // Coeffs for the model | |
69 | + if (!std::isnan(_rSun) && !std::isnan(_distIndex)){ | |
70 | + params[0] = _rSun; | |
71 | + params[1] = _distIndex; | |
72 | + } | |
73 | + else{ | |
74 | + params[0] = 0.427; | |
75 | + params[1] = 50.0; | |
76 | + } | |
77 | + | |
78 | + x = double(input[0]); | |
79 | + y = double(input[1]); | |
80 | + | |
81 | + if(_coordRef == "MSO") | |
82 | + z = double(input[2])-dz; | |
83 | + else if (_coordRef == "MSM") | |
84 | + z = double(input[2]); | |
85 | + | |
86 | + // Call to the lib to compute | |
87 | + ModelField(1,&x,&y,&z,1,2,¶ms,&Bx, &By,&Bz); | |
88 | + | |
89 | + output[0] = Bx; | |
90 | + output[1] = By; | |
91 | + output[2] = Bz; | |
92 | + | |
93 | + free(params); | |
94 | + | |
95 | + return true; | |
96 | + } | |
97 | + | |
98 | + protected: | |
99 | + virtual void | |
100 | + pushResult(vector<DataType> field_cart, DataType magnitude_) = 0; | |
101 | + ParamDataSpec<std::vector<DataType>> &_paramInput; | |
102 | + std::string _coordRef; | |
103 | + double _rSun; | |
104 | + double _distIndex; | |
105 | + TOutputParamData *_paramOutput; | |
106 | + | |
107 | + }; | |
108 | + | |
109 | + template <typename DataType> | |
110 | + class KT17Cart : public KT17<DataType, ParamDataSpec<vector<DataType>>> | |
111 | + { | |
112 | + public: | |
113 | + /** | |
114 | + * @brief Constructor. | |
115 | + * @details Create the ParamData type of the input ParamData. | |
116 | + */ | |
117 | + KT17Cart(Process &pProcess, ParamDataSpec<vector<DataType>> ¶mInput, string coordRef, double rSun, double distIndex) : | |
118 | + KT17<DataType, ParamDataSpec<vector<DataType>>>(pProcess, paramInput, coordRef, rSun, distIndex){} | |
119 | + virtual ~KT17Cart(){} | |
120 | + protected: | |
121 | + virtual void pushResult(vector<DataType> _fieldCart, DataType /*magnitude_*/){ | |
122 | + KT17<DataType, ParamDataSpec<vector<DataType>>>::_paramOutput->getDataList().push_back(_fieldCart); | |
123 | + } | |
124 | + }; | |
125 | + | |
126 | + | |
127 | + template <typename DataType> | |
128 | + class KT17Mag : public KT17<DataType, ParamDataSpec<DataType>> | |
129 | + { | |
130 | + public: | |
131 | + /** | |
132 | + * @brief Constructor. | |
133 | + * @details Create the ParamData type of the input ParamData. | |
134 | + */ | |
135 | + KT17Mag(Process &pProcess, ParamDataSpec<vector<DataType>> ¶mInput, string coordRef, double rSun, double distIndex) : | |
136 | + KT17<DataType, ParamDataSpec<DataType>>(pProcess, paramInput, coordRef, rSun, distIndex){} | |
137 | + virtual ~KT17Mag(){} | |
138 | + protected: | |
139 | + virtual void pushResult(vector<DataType> /*_fieldCart*/, DataType magnitude_){ | |
140 | + KT17<DataType, ParamDataSpec<DataType>>::_paramOutput->getDataList().push_back(magnitude_); | |
141 | + } | |
142 | + }; | |
143 | + | |
144 | + } | |
145 | +} | |
146 | +#endif /* KT17.hh */ | |
0 | 147 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,211 @@ |
1 | +/* | |
2 | + * To change this license header, choose License Headers in Project Properties. | |
3 | + * To change this template file, choose Tools | Templates | |
4 | + * and open the template in the editor. | |
5 | + */ | |
6 | + | |
7 | +/* | |
8 | + * File: KT17Creator.hh | |
9 | + * Author: Furkan - AKKA I&S | |
10 | + * | |
11 | + * Created on January 19, 2022, 4:14 PM | |
12 | + */ | |
13 | + | |
14 | +#ifndef KT17CREATOR_HH | |
15 | +#define KT17CREATOR_HH | |
16 | + | |
17 | +#include "ParamData.hh" | |
18 | +#include "VisitorOfParamData.hh" | |
19 | +#include "KT17.hh" | |
20 | + | |
21 | +namespace AMDA | |
22 | +{ | |
23 | + namespace Parameters | |
24 | + { | |
25 | + | |
26 | + class KT17Creator : public VisitorOfParamData | |
27 | + { | |
28 | + public: | |
29 | + KT17Creator(Process &pProcess, ParamData ¶mInput, std::string output,std::string coordRef, double rSun, double distIndex) | |
30 | + : _process(pProcess), _paramData(paramInput), _operation(NULL), _output(output), _coordRef(coordRef), _rSun(rSun), _distIndex(distIndex) | |
31 | + { | |
32 | + | |
33 | + _paramData.accept(*this); | |
34 | + } | |
35 | + | |
36 | + /** | |
37 | + * @overload VisitorOfParamData::visit(ParamDataScalaireShort *) | |
38 | + */ | |
39 | + void visit(ParamDataScalaireShort *) | |
40 | + { | |
41 | + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("ParamDataScalaireShort data not supported")); | |
42 | + } | |
43 | + | |
44 | + /** | |
45 | + * @overload VisitorOfParamData::visit(ParamDataScalaireFloat *) | |
46 | + */ | |
47 | + void visit(ParamDataScalaireFloat *) | |
48 | + { | |
49 | + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("ParamDataScalaireFloat data not supported")); | |
50 | + } | |
51 | + | |
52 | + /** | |
53 | + * @overload VisitorOfParamData::visit(ParamDataScalaireDouble *) | |
54 | + */ | |
55 | + void visit(ParamDataScalaireDouble *) | |
56 | + { | |
57 | + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("ParamDataScalaireDouble data not supported")); | |
58 | + } | |
59 | + | |
60 | + /** | |
61 | + * @overload VisitorOfParamData::visit(ParamDataScalaireLongDouble *) | |
62 | + */ | |
63 | + void visit(ParamDataScalaireLongDouble *) | |
64 | + { | |
65 | + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("ParamDataScalaireLongDouble data not supported")); | |
66 | + } | |
67 | + | |
68 | + /** | |
69 | + * @overload VisitorOfParamData::visit(ParamDataScalaireInt *) | |
70 | + */ | |
71 | + void visit(ParamDataScalaireInt *) | |
72 | + { | |
73 | + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("ParamDataScalaireInt data not supported")); | |
74 | + } | |
75 | + | |
76 | + /** | |
77 | + * @overload VisitorOfParamData::visit(ParamDataLogicalData *) | |
78 | + */ | |
79 | + void visit(ParamDataLogicalData *) | |
80 | + { | |
81 | + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("ParamDataLogicalData data not supported")); | |
82 | + } | |
83 | + | |
84 | + /** | |
85 | + * @overload VisitorOfParamData::visit(ParamDataTab1DShort *) | |
86 | + */ | |
87 | + void visit(ParamDataTab1DShort *) | |
88 | + { | |
89 | + create<short>(); | |
90 | + } | |
91 | + | |
92 | + /** | |
93 | + * @overload VisitorOfParamData::visit(ParamDataTab1DFloat *) | |
94 | + */ | |
95 | + void visit(ParamDataTab1DFloat *) | |
96 | + { | |
97 | + create<float>(); | |
98 | + } | |
99 | + | |
100 | + /** | |
101 | + * @overload VisitorOfParamData::visit(ParamDataTab1DDouble *) | |
102 | + */ | |
103 | + void visit(ParamDataTab1DDouble *) | |
104 | + { | |
105 | + create<double>(); | |
106 | + } | |
107 | + | |
108 | + /** | |
109 | + * @overload VisitorOfParamData::visit(ParamDataTab1DLongDouble *) | |
110 | + */ | |
111 | + void visit(ParamDataTab1DLongDouble *) | |
112 | + { | |
113 | + create<long double>(); | |
114 | + } | |
115 | + | |
116 | + /** | |
117 | + * @overload VisitorOfParamData::visit(ParamDataTab1DInt *) | |
118 | + */ | |
119 | + void visit(ParamDataTab1DInt *) | |
120 | + { | |
121 | + create<int>(); | |
122 | + } | |
123 | + | |
124 | + /** | |
125 | + * @overload VisitorOfParamData::visit(ParamDataTab1DLogicalData *) | |
126 | + */ | |
127 | + void visit(ParamDataTab1DLogicalData *) | |
128 | + { | |
129 | + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("ParamDataTab1DLogicalData data not supported")); | |
130 | + } | |
131 | + | |
132 | + /** | |
133 | + * @overload VisitorOfParamData::visit(ParamDataTab2DShort *) | |
134 | + */ | |
135 | + void visit(ParamDataTab2DShort *) | |
136 | + { | |
137 | + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("ParamDataTab2DShort data not supported")); | |
138 | + } | |
139 | + | |
140 | + /** | |
141 | + * @overload VisitorOfParamData::visit(ParamDataTab2DFloat *) | |
142 | + */ | |
143 | + void visit(ParamDataTab2DFloat *) | |
144 | + { | |
145 | + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("ParamDataTab2DFloat data not supported")); | |
146 | + } | |
147 | + | |
148 | + /** | |
149 | + * @overload VisitorOfParamData::visit(ParamDataTab2DDouble *) | |
150 | + */ | |
151 | + void visit(ParamDataTab2DDouble *) | |
152 | + { | |
153 | + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("ParamDataTab2DDouble data not supported")); | |
154 | + } | |
155 | + | |
156 | + /** | |
157 | + * @overload VisitorOfParamData::visit(ParamDataTab2DLongDouble *) | |
158 | + */ | |
159 | + void visit(ParamDataTab2DLongDouble *) | |
160 | + { | |
161 | + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("ParamDataTab2DLongDouble data not supported")); | |
162 | + } | |
163 | + | |
164 | + /** | |
165 | + * @overload VisitorOfParamData::visit(ParamDataTab2DInt *) | |
166 | + */ | |
167 | + void visit(ParamDataTab2DInt *) | |
168 | + { | |
169 | + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("ParamDataTab2DInt data not supported")); | |
170 | + } | |
171 | + | |
172 | + /** | |
173 | + * @overload VisitorOfParamData::visit(ParamDataTab2DLogicalData *) | |
174 | + */ | |
175 | + void visit(ParamDataTab2DLogicalData *) | |
176 | + { | |
177 | + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("ParamDataTab2DLogicalData data not supported")); | |
178 | + } | |
179 | + | |
180 | + /** | |
181 | + * @brief get the TimeShifted parameterized operation. | |
182 | + */ | |
183 | + Operation *getOperation() const | |
184 | + { | |
185 | + return _operation; | |
186 | + } | |
187 | + | |
188 | + template <typename DataType> | |
189 | + void create() | |
190 | + { | |
191 | + if(_output == "cart") | |
192 | + _operation = new KT17Cart<DataType>(_process, dynamic_cast<ParamDataSpec<std::vector<DataType>> &>(_paramData), _coordRef, _rSun, _distIndex); | |
193 | + else if(_output == "mag") | |
194 | + _operation = new KT17Mag<DataType>(_process, dynamic_cast<ParamDataSpec<std::vector<DataType>> &>(_paramData), _coordRef,_rSun, _distIndex); | |
195 | + else | |
196 | + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg(" output type not supported")); | |
197 | + } | |
198 | + | |
199 | + private: | |
200 | + Process &_process; | |
201 | + ParamData &_paramData; | |
202 | + Operation *_operation; | |
203 | + std::string _output; | |
204 | + std::string _coordRef; | |
205 | + double _rSun; | |
206 | + double _distIndex; | |
207 | + }; | |
208 | + } | |
209 | +} | |
210 | + | |
211 | +#endif /* KT17CREATOR_HH */ | ... | ... |
... | ... | @@ -0,0 +1,72 @@ |
1 | +/* | |
2 | + * To change this license header, choose License Headers in Project Properties. | |
3 | + * To change this template file, choose Tools | Templates | |
4 | + * and open the template in the editor. | |
5 | + */ | |
6 | + | |
7 | +/* | |
8 | + * File: KT17_CartProcess.cc | |
9 | + * Author: Furkan - AKKA I&S | |
10 | + * | |
11 | + * Created on January 19, 2022, 4:14 PM | |
12 | + */ | |
13 | +#include <stdlib.h> | |
14 | +#include <string> | |
15 | + | |
16 | +#include "Operation.hh" | |
17 | +#include "ParameterManager.hh" | |
18 | +#include "ParameterCreatorFromExpression.hh" | |
19 | +#include "KT17_CartProcess.hh" | |
20 | +#include "KT17Creator.hh" | |
21 | + | |
22 | +namespace AMDA | |
23 | +{ | |
24 | + namespace Parameters | |
25 | + { | |
26 | + | |
27 | + KT17_CartProcess::KT17_CartProcess(Parameter ¶meter) : SingleParamProcess_CRTP(parameter) | |
28 | + { | |
29 | + } | |
30 | + | |
31 | + KT17_CartProcess::KT17_CartProcess(const KT17_CartProcess &pProcess, Parameter ¶meter) : SingleParamProcess_CRTP(pProcess, parameter) | |
32 | + { | |
33 | + } | |
34 | + | |
35 | + TimeStamp KT17_CartProcess::init() | |
36 | + { | |
37 | + | |
38 | + TimeStamp timeStamp = _parameterInput->init(this, _timeIntervalList); | |
39 | + Parameter::InfoList lInfoList = _parameterInput->getInfoList(); | |
40 | + _parameter.getInfoList().insert(lInfoList.begin(), lInfoList.end()); | |
41 | + _paramInput = _parameterInput->getParamData(this).get(); | |
42 | + | |
43 | + /* Get R_sun && disIndex*/ | |
44 | + std::string inputRef = "MSO"; | |
45 | + double rSun = NAN ; | |
46 | + double distIndex = NAN; | |
47 | + | |
48 | + if(!_attributList.empty()){ | |
49 | + if (_attributList[0] == "MSO" || _attributList[0] == "MSM") | |
50 | + inputRef = _attributList[0]; | |
51 | + | |
52 | + if (_attributList.size() == 3){ | |
53 | + rSun = std::stod(_attributList[1]); | |
54 | + distIndex = std::stod(_attributList[2]); | |
55 | + } | |
56 | + | |
57 | + KT17Creator lCreator(*this, *_paramInput, "cart", inputRef, rSun, distIndex); | |
58 | + _operation = lCreator.getOperation(); | |
59 | + _paramData = ParamDataSPtr(_operation->getParamOutput()); | |
60 | + _paramData->setMinSampling(_paramInput->getMinSampling()); | |
61 | + return timeStamp; | |
62 | + } | |
63 | + else{ | |
64 | + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg(" KT17: need the coordRef")); | |
65 | + } | |
66 | + } | |
67 | + | |
68 | + KT17_CartProcess::~KT17_CartProcess() | |
69 | + { | |
70 | + } | |
71 | + } | |
72 | +} | |
0 | 73 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,41 @@ |
1 | +/* | |
2 | + * To change this license header, choose License Headers in Project Properties. | |
3 | + * To change this template file, choose Tools | Templates | |
4 | + * and open the template in the editor. | |
5 | + */ | |
6 | + | |
7 | +/* | |
8 | + * File: KT17_Process.hh | |
9 | + * Author: Furkan - AKKA I&S | |
10 | + * | |
11 | + * Created on January 19, 2022, 4:14 PM | |
12 | + */ | |
13 | + | |
14 | +#ifndef KT17_CARTPROCESS_HH | |
15 | +#define KT17_CARTPROCESS_HH | |
16 | + | |
17 | +#include "SingleParamProcess.hh" | |
18 | +#include "KT17.hh" | |
19 | + | |
20 | +namespace AMDA | |
21 | +{ | |
22 | + namespace Parameters | |
23 | + { | |
24 | + | |
25 | + class KT17_CartProcess : public AMDA::Parameters::SingleParamProcess_CRTP<KT17_CartProcess> | |
26 | + { | |
27 | + public: | |
28 | + // InternalFieldProcess(void); | |
29 | + KT17_CartProcess(Parameter ¶meter); | |
30 | + KT17_CartProcess(const KT17_CartProcess &pProcess, Parameter &pParameter); | |
31 | + virtual ~KT17_CartProcess(); | |
32 | + | |
33 | + /** | |
34 | + * @overload DataWriter::init() | |
35 | + */ | |
36 | + TimeStamp init(); | |
37 | + | |
38 | + }; | |
39 | + } | |
40 | +} | |
41 | +#endif /* KT17_CARTPROCESS_HH */ | ... | ... |
... | ... | @@ -0,0 +1,72 @@ |
1 | +/* | |
2 | + * To change this license header, choose License Headers in Project Properties. | |
3 | + * To change this template file, choose Tools | Templates | |
4 | + * and open the template in the editor. | |
5 | + */ | |
6 | + | |
7 | +/* | |
8 | + * File: KT17_MagProcess.cc | |
9 | + * Author: Furkan - AKKA I&S | |
10 | + * | |
11 | + * Created on January 19, 2022, 4:14 PM | |
12 | + */ | |
13 | +#include <stdlib.h> | |
14 | +#include <string> | |
15 | + | |
16 | +#include "Operation.hh" | |
17 | +#include "ParameterManager.hh" | |
18 | +#include "ParameterCreatorFromExpression.hh" | |
19 | +#include "KT17_MagProcess.hh" | |
20 | +#include "KT17Creator.hh" | |
21 | + | |
22 | +namespace AMDA | |
23 | +{ | |
24 | + namespace Parameters | |
25 | + { | |
26 | + | |
27 | + KT17_MagProcess::KT17_MagProcess(Parameter ¶meter) : SingleParamProcess_CRTP(parameter) | |
28 | + { | |
29 | + } | |
30 | + | |
31 | + KT17_MagProcess::KT17_MagProcess(const KT17_MagProcess &pProcess, Parameter ¶meter) : SingleParamProcess_CRTP(pProcess, parameter) | |
32 | + { | |
33 | + } | |
34 | + | |
35 | + TimeStamp KT17_MagProcess::init() | |
36 | + { | |
37 | + | |
38 | + TimeStamp timeStamp = _parameterInput->init(this, _timeIntervalList); | |
39 | + Parameter::InfoList lInfoList = _parameterInput->getInfoList(); | |
40 | + _parameter.getInfoList().insert(lInfoList.begin(), lInfoList.end()); | |
41 | + _paramInput = _parameterInput->getParamData(this).get(); | |
42 | + | |
43 | + /* Get R_sun && disIndex*/ | |
44 | + std::string inputRef = "MSO"; | |
45 | + double rSun = NAN ; | |
46 | + double distIndex = NAN; | |
47 | + | |
48 | + if(!_attributList.empty()){ | |
49 | + if (_attributList[0] == "MSO" || _attributList[0] == "MSM") | |
50 | + inputRef = _attributList[0]; | |
51 | + | |
52 | + if (_attributList.size() == 3){ | |
53 | + rSun = std::stod(_attributList[1]); | |
54 | + distIndex = std::stod(_attributList[2]); | |
55 | + } | |
56 | + | |
57 | + KT17Creator lCreator(*this, *_paramInput, "mag", inputRef,rSun, distIndex); | |
58 | + _operation = lCreator.getOperation(); | |
59 | + _paramData = ParamDataSPtr(_operation->getParamOutput()); | |
60 | + _paramData->setMinSampling(_paramInput->getMinSampling()); | |
61 | + return timeStamp; | |
62 | + } | |
63 | + else{ | |
64 | + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg(" KT17: need the coordRef")); | |
65 | + } | |
66 | + } | |
67 | + | |
68 | + KT17_MagProcess::~KT17_MagProcess() | |
69 | + { | |
70 | + } | |
71 | + } | |
72 | +} | |
0 | 73 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,41 @@ |
1 | +/* | |
2 | + * To change this license header, choose License Headers in Project Properties. | |
3 | + * To change this template file, choose Tools | Templates | |
4 | + * and open the template in the editor. | |
5 | + */ | |
6 | + | |
7 | +/* | |
8 | + * File: KT17_MagProcess.hh | |
9 | + * Author: Furkan - AKKA I&S | |
10 | + * | |
11 | + * Created on January 19, 2022, 4:14 PM | |
12 | + */ | |
13 | + | |
14 | +#ifndef KT17_MAGPROCESS_HH | |
15 | +#define KT17_MAGPROCESS_HH | |
16 | + | |
17 | +#include "SingleParamProcess.hh" | |
18 | +#include "KT17.hh" | |
19 | + | |
20 | +namespace AMDA | |
21 | +{ | |
22 | + namespace Parameters | |
23 | + { | |
24 | + | |
25 | + class KT17_MagProcess : public AMDA::Parameters::SingleParamProcess_CRTP<KT17_MagProcess> | |
26 | + { | |
27 | + public: | |
28 | + // InternalFieldProcess(void); | |
29 | + KT17_MagProcess(Parameter ¶meter); | |
30 | + KT17_MagProcess(const KT17_MagProcess &pProcess, Parameter &pParameter); | |
31 | + virtual ~KT17_MagProcess(); | |
32 | + | |
33 | + /** | |
34 | + * @overload DataWriter::init() | |
35 | + */ | |
36 | + TimeStamp init(); | |
37 | + | |
38 | + }; | |
39 | + } | |
40 | +} | |
41 | +#endif /* KT17_MAGPROCESS_HH */ | ... | ... |