Commit 274e80ebd7df454a46cd404b610ce062d1e3bd54
1 parent
fc7f9882
Exists in
master
and in
25 other branches
Final fixes for kt17
Showing
5 changed files
with
21 additions
and
58 deletions
Show diff stats
cmake/modules/FindKT17.cmake
src/ExternLib/KT17/KT17.hh
... | ... | @@ -7,7 +7,7 @@ |
7 | 7 | #ifndef KT17_HH |
8 | 8 | #define KT17_HH |
9 | 9 | |
10 | -#include "libkt/libkt.h" // If we name it this way | |
10 | +#include "libkt.h" // If we name it this way | |
11 | 11 | |
12 | 12 | #include "Parameter.hh" |
13 | 13 | #include "ParamData.hh" |
... | ... | @@ -25,8 +25,8 @@ namespace AMDA |
25 | 25 | class KT17 : public Operation |
26 | 26 | { |
27 | 27 | public: |
28 | - KT17(Process &pProcess, ParamDataSpec<vector<DataType>> ¶mInput, string coordRef, bool useAberrated, double vsw, double rSun, double distIndex) | |
29 | - : Operation(pProcess), _paramInput(paramInput), _coordRef(coordRef), _useAberrated(useAberrated), _vsw(vsw), _rSun(rSun), _distIndex(distIndex), | |
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 | 30 | _paramOutput(new TOutputParamData()) |
31 | 31 | { |
32 | 32 | _paramDataOutput = _paramOutput; |
... | ... | @@ -74,20 +74,9 @@ namespace AMDA |
74 | 74 | params[0] = 0.427; |
75 | 75 | params[1] = 50.0; |
76 | 76 | } |
77 | - // Computing the Aberrated MSM | |
78 | - if(_useAberrated){ | |
79 | - if(std::isnan(_vsw)) | |
80 | - _vsw=400; | |
81 | - double nu = pow((GV*M_SUN* (2/(params[0]*1.496e8)-1/SEMIMAJOR_MERCURY) * 1e-9),0.5); | |
82 | - double abe_angle = atan2(-nu, _vsw); | |
83 | - | |
84 | - x = double(input[0]) * cos(abe_angle) + double(input[1]) * sin(abe_angle); | |
85 | - y = -double(input[0]) * sin(abe_angle) + double(input[1]) * cos(abe_angle); | |
86 | - } | |
87 | - else{ | |
88 | - x = double(input[0]); | |
89 | - y = double(input[1]); | |
90 | - } | |
77 | + | |
78 | + x = double(input[0]); | |
79 | + y = double(input[1]); | |
91 | 80 | |
92 | 81 | if(_coordRef == "MSO") |
93 | 82 | z = double(input[2])-dz; |
... | ... | @@ -111,8 +100,6 @@ namespace AMDA |
111 | 100 | pushResult(vector<DataType> field_cart, DataType magnitude_) = 0; |
112 | 101 | ParamDataSpec<std::vector<DataType>> &_paramInput; |
113 | 102 | std::string _coordRef; |
114 | - bool _useAberrated; | |
115 | - double _vsw; | |
116 | 103 | double _rSun; |
117 | 104 | double _distIndex; |
118 | 105 | TOutputParamData *_paramOutput; |
... | ... | @@ -127,8 +114,8 @@ namespace AMDA |
127 | 114 | * @brief Constructor. |
128 | 115 | * @details Create the ParamData type of the input ParamData. |
129 | 116 | */ |
130 | - KT17Cart(Process &pProcess, ParamDataSpec<vector<DataType>> ¶mInput, string coordRef, bool useAberrated, double vsw, double rSun, double distIndex) : | |
131 | - KT17<DataType, ParamDataSpec<vector<DataType>>>(pProcess, paramInput, coordRef, useAberrated, vsw, rSun, distIndex){} | |
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){} | |
132 | 119 | virtual ~KT17Cart(){} |
133 | 120 | protected: |
134 | 121 | virtual void pushResult(vector<DataType> _fieldCart, DataType /*magnitude_*/){ |
... | ... | @@ -145,8 +132,8 @@ namespace AMDA |
145 | 132 | * @brief Constructor. |
146 | 133 | * @details Create the ParamData type of the input ParamData. |
147 | 134 | */ |
148 | - KT17Mag(Process &pProcess, ParamDataSpec<vector<DataType>> ¶mInput, string coordRef, bool useAberrated, double vsw, double rSun, double distIndex) : | |
149 | - KT17<DataType, ParamDataSpec<DataType>>(pProcess, paramInput, coordRef, useAberrated, vsw, rSun, distIndex){} | |
135 | + KT17Mag(Process &pProcess, ParamDataSpec<vector<DataType>> ¶mInput, string coordRef, double rSun, double distIndex) : | |
136 | + KT17<DataType, ParamDataSpec<DataType>>(pProcess, paramInput, coordRef, rSun, distIndex){} | |
150 | 137 | virtual ~KT17Mag(){} |
151 | 138 | protected: |
152 | 139 | virtual void pushResult(vector<DataType> /*_fieldCart*/, DataType magnitude_){ | ... | ... |
src/ExternLib/KT17/KT17Creator.hh
... | ... | @@ -26,8 +26,8 @@ namespace AMDA |
26 | 26 | class KT17Creator : public VisitorOfParamData |
27 | 27 | { |
28 | 28 | public: |
29 | - KT17Creator(Process &pProcess, ParamData ¶mInput, std::string output,std::string coordRef, bool useAberrated, double vsw, double rSun, double distIndex) | |
30 | - : _process(pProcess), _paramData(paramInput), _operation(NULL), _output(output), _coordRef(coordRef), _useAberrated(useAberrated), _vsw(vsw), _rSun(rSun), _distIndex(distIndex) | |
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 | 31 | { |
32 | 32 | |
33 | 33 | _paramData.accept(*this); |
... | ... | @@ -189,9 +189,9 @@ namespace AMDA |
189 | 189 | void create() |
190 | 190 | { |
191 | 191 | if(_output == "cart") |
192 | - _operation = new KT17Cart<DataType>(_process, dynamic_cast<ParamDataSpec<std::vector<DataType>> &>(_paramData), _coordRef,_useAberrated, _vsw, _rSun, _distIndex); | |
192 | + _operation = new KT17Cart<DataType>(_process, dynamic_cast<ParamDataSpec<std::vector<DataType>> &>(_paramData), _coordRef, _rSun, _distIndex); | |
193 | 193 | else if(_output == "mag") |
194 | - _operation = new KT17Mag<DataType>(_process, dynamic_cast<ParamDataSpec<std::vector<DataType>> &>(_paramData), _coordRef,_useAberrated, _vsw, _rSun, _distIndex); | |
194 | + _operation = new KT17Mag<DataType>(_process, dynamic_cast<ParamDataSpec<std::vector<DataType>> &>(_paramData), _coordRef,_rSun, _distIndex); | |
195 | 195 | else |
196 | 196 | BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg(" output type not supported")); |
197 | 197 | } |
... | ... | @@ -202,8 +202,6 @@ namespace AMDA |
202 | 202 | Operation *_operation; |
203 | 203 | std::string _output; |
204 | 204 | std::string _coordRef; |
205 | - bool _useAberrated; | |
206 | - double _vsw; | |
207 | 205 | double _rSun; |
208 | 206 | double _distIndex; |
209 | 207 | }; | ... | ... |
src/ExternLib/KT17/KT17_CartProcess.cc
... | ... | @@ -42,8 +42,6 @@ namespace AMDA |
42 | 42 | |
43 | 43 | /* Get R_sun && disIndex*/ |
44 | 44 | std::string inputRef = "MSO"; |
45 | - bool useAberrated = false; | |
46 | - double vsw = NAN; | |
47 | 45 | double rSun = NAN ; |
48 | 46 | double distIndex = NAN; |
49 | 47 | |
... | ... | @@ -52,20 +50,11 @@ namespace AMDA |
52 | 50 | inputRef = _attributList[0]; |
53 | 51 | |
54 | 52 | if (_attributList.size() == 3){ |
55 | - useAberrated = std::stoi(_attributList[1]); | |
56 | - if(useAberrated) | |
57 | - vsw = std::stod(_attributList[2]); | |
58 | - } | |
59 | - else if (_attributList.size() == 5) | |
60 | - { | |
61 | - useAberrated = std::stoi(_attributList[1]); | |
62 | - if(useAberrated) | |
63 | - vsw = std::stod(_attributList[2]); | |
64 | - rSun = std::stod(_attributList[3]); | |
65 | - distIndex = std::stod(_attributList[4]); | |
53 | + rSun = std::stod(_attributList[1]); | |
54 | + distIndex = std::stod(_attributList[2]); | |
66 | 55 | } |
67 | 56 | |
68 | - KT17Creator lCreator(*this, *_paramInput, "cart", inputRef,useAberrated, vsw, rSun, distIndex); | |
57 | + KT17Creator lCreator(*this, *_paramInput, "cart", inputRef, rSun, distIndex); | |
69 | 58 | _operation = lCreator.getOperation(); |
70 | 59 | _paramData = ParamDataSPtr(_operation->getParamOutput()); |
71 | 60 | _paramData->setMinSampling(_paramInput->getMinSampling()); | ... | ... |
src/ExternLib/KT17/KT17_MagProcess.cc
... | ... | @@ -42,8 +42,6 @@ namespace AMDA |
42 | 42 | |
43 | 43 | /* Get R_sun && disIndex*/ |
44 | 44 | std::string inputRef = "MSO"; |
45 | - bool useAberrated = false; | |
46 | - double vsw = NAN; | |
47 | 45 | double rSun = NAN ; |
48 | 46 | double distIndex = NAN; |
49 | 47 | |
... | ... | @@ -52,20 +50,11 @@ namespace AMDA |
52 | 50 | inputRef = _attributList[0]; |
53 | 51 | |
54 | 52 | if (_attributList.size() == 3){ |
55 | - useAberrated = std::stoi(_attributList[1]); | |
56 | - if(useAberrated) | |
57 | - vsw = std::stod(_attributList[2]); | |
58 | - } | |
59 | - else if (_attributList.size() == 5) | |
60 | - { | |
61 | - useAberrated = std::stoi(_attributList[1]); | |
62 | - if(useAberrated) | |
63 | - vsw = std::stod(_attributList[2]); | |
64 | - rSun = std::stod(_attributList[3]); | |
65 | - distIndex = std::stod(_attributList[4]); | |
53 | + rSun = std::stod(_attributList[1]); | |
54 | + distIndex = std::stod(_attributList[2]); | |
66 | 55 | } |
67 | 56 | |
68 | - KT17Creator lCreator(*this, *_paramInput, "mag", inputRef,useAberrated, vsw, rSun, distIndex); | |
57 | + KT17Creator lCreator(*this, *_paramInput, "mag", inputRef,rSun, distIndex); | |
69 | 58 | _operation = lCreator.getOperation(); |
70 | 59 | _paramData = ParamDataSPtr(_operation->getParamOutput()); |
71 | 60 | _paramData->setMinSampling(_paramInput->getMinSampling()); | ... | ... |