Commit be507aed10837d1cf2341b8370437c5f8432309b
1 parent
770bc832
Exists in
master
and in
100 other branches
Add pluggin to retrieve Juno Jeni energy tables
Showing
15 changed files
with
671 additions
and
0 deletions
Show diff stats
CMakeLists.txt
... | ... | @@ -92,6 +92,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/") |
92 | 92 | add_subdirectory(src/ExternLib/GetClbInfo) |
93 | 93 | add_subdirectory(src/ExternLib/GetClbInfoByIndex) |
94 | 94 | add_subdirectory(src/ExternLib/GetMavenStaticEnergy) |
95 | + add_subdirectory(src/ExternLib/GetJunoJediEnergy) | |
95 | 96 | add_subdirectory(src/ExternLib/EnergyBounds) |
96 | 97 | add_subdirectory(src/ExternLib/Boxcar) |
97 | 98 | add_subdirectory(src/ExternLib/SlidingAverage) | ... | ... |
... | ... | @@ -0,0 +1,85 @@ |
1 | +/* -*- Base: 10 ; Mode: C++ -*- */ | |
2 | +/*------------------------------------------------------------------------ | |
3 | + ** | |
4 | + FOST project | |
5 | + ** | |
6 | +-------------------------------------------------------------------------- | |
7 | +-------------------------------------------------------------------------- | |
8 | + FILE LOG | |
9 | + $Revision: 1.3 $ $Date: 2012-06-15 13:04:42 $ | |
10 | +-------------------------------------------------------------------------- | |
11 | +CREATION | |
12 | + V.SAC | |
13 | + | |
14 | +SUMMARY | |
15 | + | |
16 | +DESCRIPTION | |
17 | + | |
18 | + The main function performs the following actions : | |
19 | + <ul> | |
20 | + <li> | |
21 | + </ul> | |
22 | + | |
23 | +------------------------------------------------------------------------*/ | |
24 | + | |
25 | +//============================================================================= | |
26 | +// | |
27 | +// History of code | |
28 | +// | |
29 | +// creation | |
30 | +// | |
31 | +// modification | |
32 | +//============================================================================= | |
33 | + | |
34 | +/** | |
35 | + | |
36 | +*/ | |
37 | +//============================================================================= | |
38 | +// Include section | |
39 | +//============================================================================= | |
40 | + | |
41 | +// Standard libraries include files | |
42 | +//----------------------------------------------------------------------------- | |
43 | +#include <iostream> | |
44 | + | |
45 | +// Include oriented definitions | |
46 | +//----------------------------------------------------------------------------- | |
47 | + | |
48 | +// Module Kernel include files | |
49 | +//----------------------------------------------------------------------------- | |
50 | + | |
51 | +#include "GetJunoJediEnergyProcess.hh" | |
52 | +#include "ServicesServer.hh" | |
53 | +#include "PluginManager.hh" | |
54 | + | |
55 | +using namespace AMDA::Parameters; | |
56 | + | |
57 | +// Other modules include files | |
58 | +//----------------------------------------------------------------------------- | |
59 | + | |
60 | +//============================================================================= | |
61 | +// Methods of Class AMDAPlugin | |
62 | +//============================================================================= | |
63 | + | |
64 | + | |
65 | + | |
66 | +/** | |
67 | + Retrieve the Plugin version we're going to expect | |
68 | +*/ | |
69 | +extern "C" const char* getPluginVersion() | |
70 | +{ | |
71 | + return "(Version)"; | |
72 | +} | |
73 | + | |
74 | +/** | |
75 | + Tells us to register our functionality to an engine kernel | |
76 | +*/ | |
77 | +extern "C" void registerPlugin(AMDA::Plugins::PluginManager & /*pm*/) | |
78 | +{ | |
79 | + ProcessFactory factProcessGetJunoJediLowerEnergy = boost::factory<AMDA::JunoJedi::GetJunoJediLowerEnergyProcess*>(); | |
80 | + ServicesServer::getInstance()->addProcessFactory("getJunoJediLowerEnergy", factProcessGetJunoJediLowerEnergy); | |
81 | + | |
82 | + ProcessFactory factProcessGetJunoJediUpperEnergy = boost::factory<AMDA::JunoJedi::GetJunoJediUpperEnergyProcess*>(); | |
83 | + | |
84 | + ServicesServer::getInstance()->addProcessFactory("getJunoJediUpperEnergy", factProcessGetJunoJediUpperEnergy); | |
85 | +} | ... | ... |
... | ... | @@ -0,0 +1,33 @@ |
1 | + | |
2 | +PROJECT(GetJunoJediEnergy) | |
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 | + ${LOG4CXX_INCLUDE_DIR} | |
14 | + ${Boost_INCLUDE_DIR} | |
15 | +) | |
16 | + | |
17 | +#Library configuration | |
18 | +file( | |
19 | + GLOB_RECURSE | |
20 | + source_files | |
21 | + ./* | |
22 | +) | |
23 | + | |
24 | +ADD_LIBRARY( GetJunoJediEnergy SHARED ${source_files} ) | |
25 | + | |
26 | + | |
27 | +target_link_libraries( | |
28 | + GetJunoJediEnergy | |
29 | + ${LOG4CXX_LIBRARIES} | |
30 | + Parameters | |
31 | + InternLib | |
32 | + TimeTableCatalog | |
33 | +) | ... | ... |
... | ... | @@ -0,0 +1,132 @@ |
1 | +/* | |
2 | + * GetJunoJediEnergy.hh | |
3 | + * | |
4 | + * Created on: Aug 25, 2017 | |
5 | + * Author: AKKA | |
6 | + */ | |
7 | + | |
8 | +#ifndef GetJunoJediEnergy_HH_ | |
9 | +#define GetJunoJediEnergy_HH_ | |
10 | + | |
11 | +#include "vector" | |
12 | + | |
13 | +#include <boost/algorithm/string.hpp> | |
14 | +#include <boost/lexical_cast.hpp> | |
15 | + | |
16 | +#include "AMDA_exception.hh" | |
17 | +#include "DicError.hh" | |
18 | + | |
19 | +#include "Parameter.hh" | |
20 | +#include "ParamData.hh" | |
21 | +#include "Operation.hh" | |
22 | + | |
23 | +using namespace std; | |
24 | +using namespace boost; | |
25 | +using namespace AMDA::Parameters; | |
26 | + | |
27 | +namespace AMDA { | |
28 | +namespace JunoJedi { | |
29 | + | |
30 | +namespace Base { | |
31 | +/** | |
32 | + * @class Base::GetJunoJediEnergy | |
33 | + * @brief Compute Juno Jedi energy | |
34 | + */ | |
35 | + class GetJunoJediEnergy : public Operation { | |
36 | + public: | |
37 | + | |
38 | + /** | |
39 | + * @brief Default Constructor. | |
40 | + */ | |
41 | + GetJunoJediEnergy(Process& pProcess) : Operation(pProcess) {} | |
42 | + | |
43 | + /** | |
44 | + * @brief Destructor. | |
45 | + */ | |
46 | + virtual ~GetJunoJediEnergy() {} | |
47 | + | |
48 | + /** | |
49 | + * @brief initialize the operation . | |
50 | + * @detail initialize the operation with information stored in pInput.getInfoList() and pAttribute. | |
51 | + */ | |
52 | + virtual void init(Parameter& input, Process::AttributeList& pAttribute) = 0; | |
53 | + | |
54 | + protected: | |
55 | + }; | |
56 | + } | |
57 | + | |
58 | + | |
59 | +/** | |
60 | + * @class GetJunoJediEnergy | |
61 | + * @brief Compute Juno Jedi energy. | |
62 | + */ | |
63 | +template<class TParamData> | |
64 | +class GetJunoJediEnergy : public Base::GetJunoJediEnergy { | |
65 | +public: | |
66 | + /** | |
67 | + * @brief Constructor. | |
68 | + * @details Create the ParamData type of the input ParamData. | |
69 | + */ | |
70 | + GetJunoJediEnergy(Process& pProcess, TParamData& paramInput, const std::string& energy_band_name) | |
71 | + : Base::GetJunoJediEnergy(pProcess), _paramInput(paramInput), _paramOutput(new ParamDataTab1DFloat()), _energy_band_name(energy_band_name), _look_dir(0) { | |
72 | + _paramDataOutput=_paramOutput; | |
73 | + } | |
74 | + | |
75 | + /** | |
76 | + * | |
77 | + * @overload Base::GetJunoJediEnergy::init() | |
78 | + */ | |
79 | + void init(Parameter& pInput, Process::AttributeList& pAttribute) { | |
80 | + try { | |
81 | + _look_dir = boost::lexical_cast<int>( pAttribute[0] ); | |
82 | + if (_look_dir > 7) { | |
83 | + _look_dir = 0; | |
84 | + } | |
85 | + } catch( boost::bad_lexical_cast const& ) { | |
86 | + _look_dir = 0; | |
87 | + } | |
88 | + | |
89 | + Parameter::InfoList& lInfoList = pInput.getInfoList(); | |
90 | + | |
91 | + for (int mode = 0; mode < 2; ++mode) { | |
92 | + for (int bin = 0; bin < 24; ++bin) { | |
93 | + std::stringstream index_name; | |
94 | + index_name << _energy_band_name; | |
95 | + index_name << "_"; | |
96 | + index_name << (mode * 6 + _look_dir); | |
97 | + _energyList[mode].push_back((*lInfoList[index_name.str()].get())[bin]); | |
98 | + } | |
99 | + } | |
100 | + | |
101 | + /** | |
102 | + * @overload Operation::write(ParamDataIndexInfo &pParamDataIndexInfo) | |
103 | + */ | |
104 | + void write(ParamDataIndexInfo &pParamDataIndexInfo) { | |
105 | + unsigned int index = pParamDataIndexInfo._startIndex; | |
106 | + for (; index< pParamDataIndexInfo._startIndex + pParamDataIndexInfo._nbDataToProcess; index++) { | |
107 | + _paramOutput->pushTime(_paramInput.getTime(index)); | |
108 | + _paramOutput->getDataList().push_back((_energyList[(int)floor(_paramInput.getDataList()[index])])); | |
109 | + } | |
110 | + } | |
111 | + | |
112 | +private: | |
113 | + /** | |
114 | + * @brief It is the channel of calibration. | |
115 | + */ | |
116 | + TParamData &_paramInput; | |
117 | + | |
118 | + /** | |
119 | + * @brief It is the channel of the data shifted. | |
120 | + */ | |
121 | + ParamDataTab1DFloat *_paramOutput; | |
122 | + | |
123 | + std::map<unsigned int , std::vector<float> > _energyList; | |
124 | + | |
125 | + std::string _energy_band_name; | |
126 | + | |
127 | + int _look_dir; | |
128 | +}; | |
129 | + | |
130 | +} /* namespace JunoJedi */ | |
131 | +} /* namespace AMDA */ | |
132 | +#endif /* GetJunoJediEnergy_HH_ */ | ... | ... |
src/ExternLib/GetJunoJediEnergy/GetJunoJediEnergyCreator.hh
0 → 100644
... | ... | @@ -0,0 +1,165 @@ |
1 | +/* | |
2 | + * GetJunoJediEnergyCreator.hh | |
3 | + * | |
4 | + * Created on: Aug 25, 2017 | |
5 | + * Author: AKKA | |
6 | + */ | |
7 | + | |
8 | +#ifndef GetJunoJediEnergyCreator_HH_ | |
9 | +#define GetJunoJediEnergyCreator_HH_ | |
10 | + | |
11 | +#include "DicError.hh" | |
12 | +#include "AMDA_exception.hh" | |
13 | + | |
14 | +#include "ParamData.hh" | |
15 | +#include "VisitorOfParamData.hh" | |
16 | +#include "GetJunoJediEnergy.hh" | |
17 | + | |
18 | +namespace AMDA { | |
19 | +namespace JunoJedi { | |
20 | + | |
21 | +/** | |
22 | + * @class GetJunoJediEnergyCreator | |
23 | + * @brief Creator of the Operation GetJunoJediEnergy parameterized with ParamData input type. | |
24 | + * @details Implement the interface VisitorOfParamData. | |
25 | + */ | |
26 | +class GetJunoJediEnergyCreator : public VisitorOfParamData { | |
27 | +public: | |
28 | + /** | |
29 | + * @brief Constructor. | |
30 | + */ | |
31 | + GetJunoJediEnergyCreator(Process& pProcess, ParamData& paramInput, const std::string& energy_band_name) | |
32 | + : _process(pProcess), _paramData(paramInput), _operation(NULL), _energy_band_name(energy_band_name) { | |
33 | + | |
34 | + _paramData.accept(*this); | |
35 | + } | |
36 | + | |
37 | + /** | |
38 | + * @overload VisitorOfParamData::visit(ParamDataScalaireShort *) | |
39 | + */ | |
40 | + void visit(ParamDataScalaireShort *) {_operation = new GetJunoJediEnergy<ParamDataScalaireShort>( _process, dynamic_cast<ParamDataScalaireShort &>(_paramData), _energy_band_name);} | |
41 | + | |
42 | + /** | |
43 | + * @overload VisitorOfParamData::visit(ParamDataScalaireFloat *) | |
44 | + */ | |
45 | + void visit(ParamDataScalaireFloat *) { BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("GetJunoJediEnergyCreator operation not supported")); } | |
46 | + | |
47 | + /** | |
48 | + * @overload VisitorOfParamData::visit(ParamDataScalaireDouble *) | |
49 | + */ | |
50 | + void visit(ParamDataScalaireDouble *) { BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("GetJunoJediEnergyCreator operation not supported")); } | |
51 | + | |
52 | + /** | |
53 | + * @overload VisitorOfParamData::visit(ParamDataScalaireLongDouble *) | |
54 | + */ | |
55 | + void visit(ParamDataScalaireLongDouble *) { BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("GetJunoJediEnergyCreator operation not supported")); } | |
56 | + | |
57 | + /** | |
58 | + * @overload VisitorOfParamData::visit(ParamDataScalaireInt *) | |
59 | + */ | |
60 | + void visit(ParamDataScalaireInt *) { BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("GetJunoJediEnergyCreator operation not supported")); } | |
61 | + | |
62 | + /** | |
63 | + * @overload VisitorOfParamData::visit(ParamDataLogicalData *) | |
64 | + */ | |
65 | + void visit(ParamDataLogicalData *) { BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("GetJunoJediEnergyCreator operation not supported")); } | |
66 | + | |
67 | + /** | |
68 | + * @overload VisitorOfParamData::visit(ParamDataTab1DShort *) | |
69 | + */ | |
70 | + void visit(ParamDataTab1DShort *) { BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("GetJunoJediEnergyCreator operation not supported")); } | |
71 | + | |
72 | + /** | |
73 | + * @overload VisitorOfParamData::visit(ParamDataTab1DFloat *) | |
74 | + */ | |
75 | + void visit(ParamDataTab1DFloat *) { BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("GetJunoJediEnergyCreator operation not supported")); } | |
76 | + | |
77 | + /** | |
78 | + * @overload VisitorOfParamData::visit(ParamDataTab1DDouble *) | |
79 | + */ | |
80 | + void visit(ParamDataTab1DDouble *) { BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("GetJunoJediEnergyCreator operation not supported")); } | |
81 | + | |
82 | + /** | |
83 | + * @overload VisitorOfParamData::visit(ParamDataTab1DLongDouble *) | |
84 | + */ | |
85 | + void visit(ParamDataTab1DLongDouble *) { BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("GetJunoJediEnergyCreator operation not supported")); } | |
86 | + | |
87 | + /** | |
88 | + * @overload VisitorOfParamData::visit(ParamDataTab1DInt *) | |
89 | + */ | |
90 | + void visit(ParamDataTab1DInt *) { BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("GetJunoJediEnergyCreator operation not supported")); } | |
91 | + | |
92 | + /** | |
93 | + * @overload VisitorOfParamData::visit(ParamDataTab1DLogicalData *) | |
94 | + */ | |
95 | + void visit(ParamDataTab1DLogicalData *) { BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("GetJunoJediEnergyCreator operation not supported")); } | |
96 | + | |
97 | + /** | |
98 | + * @overload VisitorOfParamData::visit(ParamDataTab2DShort *) | |
99 | + */ | |
100 | + void visit(ParamDataTab2DShort *) { | |
101 | + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("GetJunoJediEnergyCreator operation not supported")); | |
102 | + } | |
103 | + | |
104 | + /** | |
105 | + * @overload VisitorOfParamData::visit(ParamDataTab2DFloat *) | |
106 | + */ | |
107 | + void visit(ParamDataTab2DFloat *) { | |
108 | + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("GetJunoJediEnergyCreator operation not supported")); | |
109 | + } | |
110 | + | |
111 | + /** | |
112 | + * @overload VisitorOfParamData::visit(ParamDataTab2DDouble *) | |
113 | + */ | |
114 | + void visit(ParamDataTab2DDouble *) { | |
115 | + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("GetJunoJediEnergyCreator operation not supported")); | |
116 | + } | |
117 | + | |
118 | + /** | |
119 | + * @overload VisitorOfParamData::visit(ParamDataTab2DLongDouble *) | |
120 | + */ | |
121 | + void visit(ParamDataTab2DLongDouble *) { | |
122 | + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("GetJunoJediEnergyCreator operation not supported")); | |
123 | + } | |
124 | + | |
125 | + /** | |
126 | + * @overload VisitorOfParamData::visit(ParamDataTab2DInt *) | |
127 | + */ | |
128 | + void visit(ParamDataTab2DInt *) { | |
129 | + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("GetJunoJediEnergyCreator operation not supported")); | |
130 | + } | |
131 | + | |
132 | + /** | |
133 | + * @overload VisitorOfParamData::visit(ParamDataTab2DLogicalData *) | |
134 | + */ | |
135 | + void visit(ParamDataTab2DLogicalData *) { | |
136 | + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("GetJunoJediEnergyCreator operation not supported")); | |
137 | + } | |
138 | + | |
139 | + /** | |
140 | + * @brief get the GetJunoJediEnergy parameterized operation. | |
141 | + */ | |
142 | + Operation * getOperation() const { return _operation; } | |
143 | + | |
144 | +private: | |
145 | + /** | |
146 | + * @brief a reference on the process of Calibration | |
147 | + */ | |
148 | + Process &_process; | |
149 | + | |
150 | + /** | |
151 | + * @brief the input paramData | |
152 | + */ | |
153 | + ParamData &_paramData; | |
154 | + | |
155 | + /** | |
156 | + * @brief the operation which is created | |
157 | + */ | |
158 | + Operation *_operation; | |
159 | + | |
160 | + std::string _energy_band_name; | |
161 | +}; | |
162 | + | |
163 | +} /* namespace JunoJedi */ | |
164 | +} /* namespace AMDA */ | |
165 | +#endif /* GetJunoJediEnergyCreator_HH_ */ | ... | ... |
src/ExternLib/GetJunoJediEnergy/GetJunoJediEnergyProcess.cc
0 → 100644
... | ... | @@ -0,0 +1,75 @@ |
1 | +/* | |
2 | + * GetJunoJediEnergyProcess.cc | |
3 | + * | |
4 | + * Created on: Aug 25, 2017 | |
5 | + * Author: AKKA | |
6 | + */ | |
7 | +#include <stdlib.h> | |
8 | +#include <string> | |
9 | + | |
10 | +#include "AMDA_exception.hh" | |
11 | +#include "DicError.hh" | |
12 | + | |
13 | +#include "Operation.hh" | |
14 | +#include "ParameterManager.hh" | |
15 | +#include "GetJunoJediEnergyProcess.hh" | |
16 | +#include "GetJunoJediEnergyCreator.hh" | |
17 | +#include "ParameterCreatorFromExpression.hh" | |
18 | + | |
19 | +using namespace std; | |
20 | +using namespace boost; | |
21 | +using namespace log4cxx; | |
22 | + | |
23 | +namespace AMDA { | |
24 | +namespace JunoJedi { | |
25 | + | |
26 | +GetJunoJediEnergyProcess::GetJunoJediEnergyProcess(Parameter ¶meter, EnergyBand energy_band) | |
27 | + : SingleParamProcess_CRTP(parameter), _energy_band(energy_band) { | |
28 | + } | |
29 | + | |
30 | +GetJunoJediEnergyProcess::GetJunoJediEnergyProcess(const GetJunoJediEnergyProcess& pProcess, Parameter ¶meter) | |
31 | + : SingleParamProcess_CRTP(pProcess,parameter), _energy_band(pProcess._energy_band) { | |
32 | + } | |
33 | + | |
34 | +GetJunoJediEnergyProcess::~GetJunoJediEnergyProcess() { | |
35 | + } | |
36 | + | |
37 | +TimeStamp GetJunoJediEnergyProcess::init() { | |
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 LookDir | |
44 | + if (_attributList.size() < 1) { | |
45 | + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_PROCESS_ERR) << AMDA::ex_msg(std::string("GetJunoJediEnergyProcess::init required at least one attribute for LookDir'"))); | |
46 | + } | |
47 | + | |
48 | + std::string energy_band_name; | |
49 | + switch (_energy_band) { | |
50 | + case BAND_LOWER: | |
51 | + energy_band_name = "LowerEnergy"; | |
52 | + break; | |
53 | + case BAND_UPPER: | |
54 | + energy_band_name = "UpperEnergy"; | |
55 | + break; | |
56 | + } | |
57 | + | |
58 | + GetJunoJediEnergyCreator lGetJunoJediEnergyCreator(*this,*_paramInput, energy_band_name); | |
59 | + _operation = lGetJunoJediEnergyCreator.getOperation(); | |
60 | + dynamic_cast<Base::GetJunoJediEnergy*>(_operation)->init(*_parameterInput,_attributList); | |
61 | + _paramData = ParamDataSPtr(_operation->getParamOutput()); | |
62 | + _paramData->setMinSampling(_paramInput->getMinSampling()); | |
63 | + return timeStamp; | |
64 | +} | |
65 | + | |
66 | +GetJunoJediLowerEnergyProcess::GetJunoJediLowerEnergyProcess(AMDA::Parameters::Parameter ¶meter) : GetJunoJediEnergyProcess(parameter, BAND_LOWER) { | |
67 | + | |
68 | +} | |
69 | + | |
70 | +GetJunoJediUpperEnergyProcess::GetJunoJediUpperEnergyProcess(AMDA::Parameters::Parameter ¶meter) : GetJunoJediEnergyProcess(parameter, BAND_UPPER) { | |
71 | + | |
72 | +} | |
73 | + | |
74 | +} /* namespace JunoJedi */ | |
75 | +} /* namespace AMDA */ | ... | ... |
src/ExternLib/GetJunoJediEnergy/GetJunoJediEnergyProcess.hh
0 → 100644
... | ... | @@ -0,0 +1,68 @@ |
1 | +/* | |
2 | + * GetJunoJediEnergyProcess.hh | |
3 | + * | |
4 | + * Created on: Aug 25, 2017 | |
5 | + * Author: AKKA | |
6 | + */ | |
7 | + | |
8 | +#ifndef GetJunoJedoEnergyProcess_HH_ | |
9 | +#define GetJunoJediEnergyProcess_HH_ | |
10 | + | |
11 | +#include "SingleParamProcess.hh" | |
12 | + | |
13 | +namespace AMDA { | |
14 | +namespace JunoJedi { | |
15 | + | |
16 | + /** | |
17 | + * @class GetJunoJediEnergyProcess | |
18 | + * @brief Return the energy table of Juno Jedi instrument. | |
19 | + */ | |
20 | + class GetJunoJediEnergyProcess : public AMDA::Parameters::SingleParamProcess_CRTP<GetJunoJediEnergyProcess> { | |
21 | + public: | |
22 | + | |
23 | + enum EnergyBand { | |
24 | + BAND_LOWER, | |
25 | + BAND_UPPER | |
26 | + }; | |
27 | + /** | |
28 | + * @brief Constructor. | |
29 | + */ | |
30 | + GetJunoJediEnergyProcess(AMDA::Parameters::Parameter ¶meter, EnergyBand energy_band); | |
31 | + /** | |
32 | + * @brief Copy Constructor. | |
33 | + */ | |
34 | + GetJunoJediEnergyProcess(const GetJunoJediEnergyProcess& pProcess, AMDA::Parameters::Parameter &pParameter) ; | |
35 | + /** | |
36 | + * @brief Destructor. | |
37 | + */ | |
38 | + ~GetJunoJediEnergyProcess(); | |
39 | + | |
40 | + // Overload Process methods | |
41 | + /** | |
42 | + * @overload Process::init() | |
43 | + */ | |
44 | + AMDA::Parameters::TimeStamp init(); | |
45 | + | |
46 | + private: | |
47 | + EnergyBand _energy_band; | |
48 | + }; | |
49 | + | |
50 | + class GetJunoJediLowerEnergyProcess : public GetJunoJediEnergyProcess { | |
51 | + public: | |
52 | + /** | |
53 | + * @brief Constructor. | |
54 | + */ | |
55 | + GetJunoJediLowerEnergyProcess(AMDA::Parameters::Parameter ¶meter); | |
56 | + }; | |
57 | + | |
58 | + class GetJunoJediUpperEnergyProcess : public GetJunoJediEnergyProcess { | |
59 | + public: | |
60 | + /** | |
61 | + * @brief Constructor. | |
62 | + */ | |
63 | + GetJunoJediUpperEnergyProcess(AMDA::Parameters::Parameter ¶meter); | |
64 | + }; | |
65 | + | |
66 | +} /* namespace JunoJedi */ | |
67 | +} /* namespace AMDA */ | |
68 | +#endif /* GetJunoJediEnergyProcess_HH_ */ | ... | ... |
test/data/DataBaseParameters/juno_jedi_elec_180_flux.xml
0 → 100644
... | ... | @@ -0,0 +1,27 @@ |
1 | +<?xml version="1.0"?> | |
2 | +<param xml:id='juno_jedi_elec_180_flux'> | |
3 | + <info> | |
4 | + <name>Juno Jedi Elec 180 Flux - LookDir 0</name> | |
5 | + <short_name>Elec. Flux - LookDir 0</short_name> | |
6 | + <components></components> | |
7 | + <units>Flux</units> | |
8 | + <coordinates_system></coordinates_system> | |
9 | + <tensor_order>0</tensor_order> | |
10 | + <si_conversion></si_conversion> | |
11 | + <table> | |
12 | + <minMaxTable variable="true" name="Energy" units="eV" minName="juno_jedi_elec_180_lower_energy_lookdir0" maxName="juno_jedi_elec_180_upper_energy_lookdir0"/> | |
13 | + </table> | |
14 | + <fill_value>0</fill_value> | |
15 | + <ucd></ucd> | |
16 | + <dataset_id></dataset_id> | |
17 | + </info> | |
18 | + <get> | |
19 | + <vi name='juno:jedi:e180'> | |
20 | + <baseParam name='FLUX'/> | |
21 | + </vi> | |
22 | + <amdaParam name="juno_jedi_elec_180_lower_energy_lookdir0"/> | |
23 | + <amdaParam name="juno_jedi_elec_180_upper_energy_lookdir0"/> | |
24 | + </get> | |
25 | + <process description="LookDir 0">$juno_jedi_e180_FLUX[0].toVector()</process> | |
26 | + <output/> | |
27 | +</param> | ... | ... |
test/data/DataBaseParameters/juno_jedi_elec_180_lower_energy_lookdir0.xml
0 → 100644
... | ... | @@ -0,0 +1,8 @@ |
1 | +<?xml version="1.0"?> | |
2 | +<param xml:id="juno_jedi_elec_180_lower_energy_lookdir0"> | |
3 | + <get> | |
4 | + <amdaParam name="juno_jedi_elec_180_mode"/> | |
5 | + </get> | |
6 | + <process description="JUNO JEDI 180 Elec. Lower Energy - LookDir 0">#getJunoJediLowerEnergy($juno_jedi_elec_180_mode;0)</process> | |
7 | + <output/> | |
8 | +</param> | ... | ... |
test/data/DataBaseParameters/juno_jedi_elec_180_mode.xml
0 → 100644
... | ... | @@ -0,0 +1,13 @@ |
1 | +<?xml version="1.0"?> | |
2 | +<param xml:id='juno_jedi_elec_180_mode'> | |
3 | + <get> | |
4 | + <vi name='juno:jedi:e180'> | |
5 | + <baseParam name='Mode' useNearestValue="true"> | |
6 | + <clb name="LowerEnergy"/> | |
7 | + <clb name="UpperEnergy"/> | |
8 | + </baseParam> | |
9 | + </vi> | |
10 | + </get> | |
11 | + <process/> | |
12 | + <output/> | |
13 | +</param> | ... | ... |
test/data/DataBaseParameters/juno_jedi_elec_180_upper_energy_lookdir0.xml
0 → 100644
... | ... | @@ -0,0 +1,8 @@ |
1 | +<?xml version="1.0"?> | |
2 | +<param xml:id="juno_jedi_elec_180_upper_energy_lookdir0"> | |
3 | + <get> | |
4 | + <amdaParam name="juno_jedi_elec_180_mode"/> | |
5 | + </get> | |
6 | + <process description="JUNO JEDI 180 Elec. Upper Energy - LookDir 0">#getJunoJediUpperEnergy($juno_jedi_elec_180_mode;0)</process> | |
7 | + <output/> | |
8 | +</param> | ... | ... |
... | ... | @@ -0,0 +1,27 @@ |
1 | +<?xml version="1.0"?> | |
2 | +<param xml:id='juno_jedi_ion_180_flux'> | |
3 | + <info> | |
4 | + <name>Juno Jedi Ion 180 Flux - LookDir 0</name> | |
5 | + <short_name>Ion Flux - LookDir 0</short_name> | |
6 | + <components></components> | |
7 | + <units>Flux</units> | |
8 | + <coordinates_system></coordinates_system> | |
9 | + <tensor_order>0</tensor_order> | |
10 | + <si_conversion></si_conversion> | |
11 | + <table> | |
12 | + <minMaxTable variable="true" name="Energy" units="eV" minName="juno_jedi_ion_180_lower_energy_lookdir0" maxName="juno_jedi_ion_180_upper_energy_lookdir0"/> | |
13 | + </table> | |
14 | + <fill_value>0</fill_value> | |
15 | + <ucd></ucd> | |
16 | + <dataset_id></dataset_id> | |
17 | + </info> | |
18 | + <get> | |
19 | + <vi name='juno:jedi:i180'> | |
20 | + <baseParam name='FLUX'/> | |
21 | + </vi> | |
22 | + <amdaParam name="juno_jedi_ion_180_lower_energy_lookdir0"/> | |
23 | + <amdaParam name="juno_jedi_ion_180_upper_energy_lookdir0"/> | |
24 | + </get> | |
25 | + <process description="LookDir 0">$juno_jedi_i180_FLUX[0].toVector()</process> | |
26 | + <output/> | |
27 | +</param> | ... | ... |
test/data/DataBaseParameters/juno_jedi_ion_180_lower_energy_lookdir0.xml
0 → 100644
... | ... | @@ -0,0 +1,8 @@ |
1 | +<?xml version="1.0"?> | |
2 | +<param xml:id="juno_jedi_ion_180_lower_energy_lookdir0"> | |
3 | + <get> | |
4 | + <amdaParam name="juno_jedi_ion_180_mode"/> | |
5 | + </get> | |
6 | + <process description="JUNO JEDI 180 Ion Lower Energy - LookDir 0">#getJunoJediLowerEnergy($juno_jedi_ion_180_mode;0)</process> | |
7 | + <output/> | |
8 | +</param> | ... | ... |
... | ... | @@ -0,0 +1,13 @@ |
1 | +<?xml version="1.0"?> | |
2 | +<param xml:id='juno_jedi_ion_180_mode'> | |
3 | + <get> | |
4 | + <vi name='juno:jedi:i180'> | |
5 | + <baseParam name='Mode' useNearestValue="true"> | |
6 | + <clb name="LowerEnergy"/> | |
7 | + <clb name="UpperEnergy"/> | |
8 | + </baseParam> | |
9 | + </vi> | |
10 | + </get> | |
11 | + <process/> | |
12 | + <output/> | |
13 | +</param> | ... | ... |
test/data/DataBaseParameters/juno_jedi_ion_180_upper_energy_lookdir0.xml
0 → 100644
... | ... | @@ -0,0 +1,8 @@ |
1 | +<?xml version="1.0"?> | |
2 | +<param xml:id="juno_jedi_ion_180_upper_energy_lookdir0"> | |
3 | + <get> | |
4 | + <amdaParam name="juno_jedi_ion_180_mode"/> | |
5 | + </get> | |
6 | + <process description="JUNO JEDI 180 Ion Upper Energy - LookDir 0">#getJunoJediUpperEnergy($juno_jedi_ion_180_mode;0)</process> | |
7 | + <output/> | |
8 | +</param> | ... | ... |