Commit ed9a1eaf270b1791f676678ce457ee3bb239a49c

Authored by Benjamin Renard
1 parent e6975854

Add Maven STATIC C6 & Rosetta MIP Survey parameters

Add Calibration process by indexes
Fix some bugs with spectro plot
config/DataBaseParameters/mav_sta_c6.xml 0 โ†’ 100644
@@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<param xml:id="mav_sta_c6">
  3 + <info>
  4 + <name>Eflux</name>
  5 + <short_name>Eflux</short_name>
  6 + <components></components>
  7 + <units>eV/st/sec</units>
  8 + <coordinates_system></coordinates_system>
  9 + <tensor_order>0</tensor_order>
  10 + <si_conversion></si_conversion>
  11 + <table>
  12 + <centerAutoTable variable="true" name="Energy" units="eV" centerName="mav_sta_c6_energy" log="false"/>
  13 + </table>
  14 + <fill_value>-1e+31</fill_value>
  15 + <ucd></ucd>
  16 + <dataset_id></dataset_id>
  17 + </info>
  18 + <get>
  19 + <amdaParam name="mav_sta_c6_tab2d"/>
  20 + <amdaParam name="mav_sta_c6_energy"/>
  21 + </get>
  22 + <process description="Mass 0">$mav_sta_c6_tab2d[0].toVector()</process>
  23 + <output/>
  24 +</param>
config/DataBaseParameters/mav_sta_c6_energy.xml 0 โ†’ 100644
@@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
  1 +<?xml version="1.0"?>
  2 +<param xml:id="mav_sta_c6_energy">
  3 + <get>
  4 + <vi name='mavpds:sta:c6'>
  5 + <baseParam name="swp_ind" useNearestValue="true">
  6 + <clb name="energy"/>
  7 + <clb name="nswp"/>
  8 + <clb name="nmass"/>
  9 + <clb name="nenergy"/>
  10 + </baseParam>
  11 + </vi>
  12 + </get>
  13 + <process description="MAVEN STATIC C6 Energy">#getMavenStaticEnergy($mavpds_sta_c6_swp_ind)</process>
  14 + <output/>
  15 +</param>
0 \ No newline at end of file 16 \ No newline at end of file
config/DataBaseParameters/mav_sta_c6_tab2d.xml 0 โ†’ 100644
@@ -0,0 +1,23 @@ @@ -0,0 +1,23 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<param xml:id="mav_sta_c6_tab2d">
  3 + <info>
  4 + <name>Eflux</name>
  5 + <short_name>Eflux</short_name>
  6 + <components></components>
  7 + <units>eV/st/sec</units>
  8 + <coordinates_system></coordinates_system>
  9 + <tensor_order>0</tensor_order>
  10 + <si_conversion></si_conversion>
  11 + <fill_value>-1e+31</fill_value>
  12 + <ucd></ucd>
  13 + <dataset_id></dataset_id>
  14 + </info>
  15 + <get>
  16 + <vi name="mavpds:sta:c6">
  17 + <baseParam name="eflux">
  18 + </baseParam>
  19 + </vi>
  20 + </get>
  21 + <process/>
  22 + <output/>
  23 +</param>
config/DataBaseParameters/ros_mip_surv.xml 0 โ†’ 100644
@@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
  1 +<?xml version="1.0"?>
  2 +<param xml:id="ros_mip_surv">
  3 + <info>
  4 + <name>Rosetta MIP Survey</name>
  5 + <short_name>MIP Survey</short_name>
  6 + <components></components>
  7 + <units>dB</units>
  8 + <coordinates_system></coordinates_system>
  9 + <tensor_order>0</tensor_order>
  10 + <si_conversion></si_conversion>
  11 + <table>
  12 + <centerAutoTable variable="true" name="Frequency" units="kHz" centerName="ros_mip_surv_frequency" log="true"/>
  13 + </table>
  14 + <fill_value>-1e+31</fill_value>
  15 + <ucd></ucd>
  16 + <dataset_id></dataset_id>
  17 + </info>
  18 + <get>
  19 + <vi name='ros:mip:surv'>
  20 + <baseParam name="SurveyFull"/>
  21 + </vi>
  22 + <amdaParam name="ros_mip_surv_frequency"/>
  23 + </get>
  24 + <process/>
  25 + <output/>
  26 +</param>
0 \ No newline at end of file 27 \ No newline at end of file
config/DataBaseParameters/ros_mip_surv_frequency.xml 0 โ†’ 100644
@@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
  1 +<?xml version="1.0"?>
  2 +<param xml:id="ros_mip_surv_frequency">
  3 + <get>
  4 + <vi name='ros:mip:surv'>
  5 + <baseParam name="Frequency_table_idx" useNearestValue="true">
  6 + <clb name="Frequency"/>
  7 + </baseParam>
  8 + </vi>
  9 + </get>
  10 + <process description="Rosetta MIP Survey Frequency">#getClbInfoByIndex($ros_mip_surv_Frequency_table_idx;Frequency;8)</process>
  11 + <output/>
  12 +</param>
0 \ No newline at end of file 13 \ No newline at end of file
src/ExternLib/GetClbInfoByIndex/AMDAPlugin.cc 0 โ†’ 100644
@@ -0,0 +1,81 @@ @@ -0,0 +1,81 @@
  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 "GetClbInfoByIndexProcess.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 factProcessGetClbInfoByIndex = boost::factory<AMDA::GetClbInfoByIndex::GetClbInfoByIndexProcess*>();
  80 + ServicesServer::getInstance()->addProcessFactory("getClbInfoByIndex", factProcessGetClbInfoByIndex);
  81 +}
src/ExternLib/GetClbInfoByIndex/CMakeLists.txt 0 โ†’ 100644
@@ -0,0 +1,33 @@ @@ -0,0 +1,33 @@
  1 +
  2 +PROJECT(GetClbInfoByIndex)
  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( GetClbInfoByIndex SHARED ${source_files} )
  25 +
  26 +
  27 +target_link_libraries(
  28 + GetClbInfoByIndex
  29 + ${LOG4CXX_LIBRARIES}
  30 + Parameters
  31 + InternLib
  32 + TimeTableCatalog
  33 +)
0 \ No newline at end of file 34 \ No newline at end of file
src/ExternLib/GetClbInfoByIndex/GetClbInfoByIndex.hh 0 โ†’ 100644
@@ -0,0 +1,133 @@ @@ -0,0 +1,133 @@
  1 +/*
  2 + * GetClbInfoByIndex.hh
  3 + *
  4 + * Created on: Sep 24, 2015
  5 + * Author: AKKA
  6 + */
  7 +
  8 +#ifndef GetClbInfoByIndex_HH_
  9 +#define GetClbInfoByIndex_HH_
  10 +
  11 +#include "vector"
  12 +
  13 +#include <boost/algorithm/string.hpp>
  14 +
  15 +#include "AMDA_exception.hh"
  16 +#include "DicError.hh"
  17 +
  18 +#include "Parameter.hh"
  19 +#include "ParamData.hh"
  20 +#include "Operation.hh"
  21 +
  22 +using namespace std;
  23 +using namespace boost;
  24 +using namespace AMDA::Parameters;
  25 +
  26 +namespace AMDA {
  27 +namespace GetClbInfoByIndex {
  28 +
  29 +namespace Base {
  30 +/**
  31 + * @class Base::GetClbInfoByIndex
  32 + * @brief It is responsible to shift data of any ParamData type.
  33 + * @details This class implement the interface Operation.
  34 + */
  35 + class GetClbInfoByIndex : public Operation {
  36 + public:
  37 +
  38 + /**
  39 + * @brief Default Constructor.
  40 + */
  41 + GetClbInfoByIndex(Process& pProcess) : Operation(pProcess) {}
  42 +
  43 + /**
  44 + * @brief Destructor.
  45 + */
  46 + virtual ~GetClbInfoByIndex() {}
  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 GetClbInfoByIndex
  61 + * @brief It is responsible to shift data of any ParamData type.
  62 + * @details This class implement the interface Operation for a TParamData.
  63 + */
  64 +template<class TParamData>
  65 +class GetClbInfoByIndex : public Base::GetClbInfoByIndex {
  66 +public:
  67 + /**
  68 + * @brief Constructor.
  69 + * @details Create the ParamData type of the input ParamData.
  70 + */
  71 + GetClbInfoByIndex(Process& pProcess, TParamData& paramInput)
  72 + : Base::GetClbInfoByIndex(pProcess), _paramInput(paramInput), _paramOutput(new ParamDataTab1DDouble()) {
  73 + _paramDataOutput=_paramOutput;
  74 + }
  75 +
  76 + /**
  77 + *
  78 + * @overload Base::GetClbInfoByIndex::init()
  79 + */
  80 + void init(Parameter& pInput, Process::AttributeList& pAttribute) {
  81 + Parameter::InfoList& lInfoList = pInput.getInfoList();
  82 +
  83 + std::string clbInfoName = pAttribute[0];
  84 + int size = atoi(pAttribute[1].c_str());
  85 +
  86 + for (unsigned int i=0; i < (unsigned int)size; ++i)
  87 + {
  88 + std::string clbInfoIndexName = clbInfoName;
  89 + clbInfoIndexName += "_";
  90 + clbInfoIndexName += std::to_string(i);
  91 + if (lInfoList.find(clbInfoIndexName) == lInfoList.end())
  92 + {
  93 + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_PROCESS_ERR) << AMDA::ex_msg(std::string("GetClbInfoByIndex::init - Cannot find calibInfo "+clbInfoIndexName)));
  94 + }
  95 + _calibrationInfoList[i]=lInfoList[clbInfoIndexName].get();
  96 + }
  97 + }
  98 +
  99 + /**
  100 + * @overload Operation::write(ParamDataIndexInfo &pParamDataIndexInfo)
  101 + */
  102 + void write(ParamDataIndexInfo &pParamDataIndexInfo) {
  103 + unsigned int index = pParamDataIndexInfo._startIndex;
  104 + for (; index< pParamDataIndexInfo._startIndex + pParamDataIndexInfo._nbDataToProcess; index++) {
  105 + _paramOutput->pushTime(_paramInput.getTime(index));
  106 + _paramOutput->getDataList().push_back(*(_calibrationInfoList[(int)floor(_paramInput.getDataList()[index])]));
  107 + }
  108 + }
  109 +
  110 +private:
  111 + /**
  112 + * @brief It is the channel of calibration.
  113 + */
  114 + TParamData &_paramInput;
  115 +
  116 + /**
  117 + * @brief It is the channel of the data shifted.
  118 + */
  119 + ParamDataTab1DDouble *_paramOutput;
  120 +
  121 +
  122 + /**
  123 + * @brief map of calibrationInfo.
  124 + * @detail for expression #getClbInfo($ETableN;0:ImaEner_0;1:ImaEner_1)
  125 + * the key of map is 0 respectively 1
  126 + * the value of map is the value of attributes ImaEner[0] respectively and ImaEner[0]
  127 + */
  128 + std::map<unsigned int , Parameter::InfoValues*> _calibrationInfoList;
  129 +};
  130 +
  131 +} /* namespace GetClbInfoByIndex */
  132 +} /* namespace AMDA */
  133 +#endif /* GetClbInfoByIndex_HH_ */
src/ExternLib/GetClbInfoByIndex/GetClbInfoByIndexCreator.hh 0 โ†’ 100644
@@ -0,0 +1,163 @@ @@ -0,0 +1,163 @@
  1 +/*
  2 + * GetClbInfoByIndexCreator.hh
  3 + *
  4 + * Created on: Sep 24, 2015
  5 + * Author: AKKA
  6 + */
  7 +
  8 +#ifndef GetClbInfoByIndexCREATOR_HH_
  9 +#define GetClbInfoByIndexCREATOR_HH_
  10 +
  11 +#include "DicError.hh"
  12 +#include "AMDA_exception.hh"
  13 +
  14 +#include "ParamData.hh"
  15 +#include "VisitorOfParamData.hh"
  16 +#include "GetClbInfoByIndex.hh"
  17 +
  18 +namespace AMDA {
  19 +namespace GetClbInfoByIndex {
  20 +
  21 +/**
  22 + * @class GetClbInfoByIndexCreator
  23 + * @brief Creator of the Operation GetClbInfoByIndex parameterized with ParamData input type.
  24 + * @details Implement the interface VisitorOfParamData.
  25 + */
  26 +class GetClbInfoByIndexCreator : public VisitorOfParamData {
  27 +public:
  28 + /**
  29 + * @brief Constructor.
  30 + */
  31 + GetClbInfoByIndexCreator(Process& pProcess, ParamData& paramInput)
  32 + : _process(pProcess), _paramData(paramInput), _operation(NULL) {
  33 +
  34 + _paramData.accept(*this);
  35 + }
  36 +
  37 + /**
  38 + * @overload VisitorOfParamData::visit(ParamDataScalaireShort *)
  39 + */
  40 + void visit(ParamDataScalaireShort *) {_operation = new GetClbInfoByIndex<ParamDataScalaireShort>( _process, dynamic_cast<ParamDataScalaireShort &>(_paramData));}
  41 +
  42 + /**
  43 + * @overload VisitorOfParamData::visit(ParamDataScalaireFloat *)
  44 + */
  45 + void visit(ParamDataScalaireFloat *) {_operation = new GetClbInfoByIndex<ParamDataScalaireFloat>( _process, dynamic_cast<ParamDataScalaireFloat &>(_paramData));}
  46 +
  47 + /**
  48 + * @overload VisitorOfParamData::visit(ParamDataScalaireDouble *)
  49 + */
  50 + void visit(ParamDataScalaireDouble *) {_operation = new GetClbInfoByIndex<ParamDataScalaireDouble>( _process,dynamic_cast<ParamDataScalaireDouble &>(_paramData));}
  51 +
  52 + /**
  53 + * @overload VisitorOfParamData::visit(ParamDataScalaireLongDouble *)
  54 + */
  55 + void visit(ParamDataScalaireLongDouble *) {_operation = new GetClbInfoByIndex<ParamDataScalaireLongDouble>( _process, dynamic_cast<ParamDataScalaireLongDouble &>(_paramData));}
  56 +
  57 + /**
  58 + * @overload VisitorOfParamData::visit(ParamDataScalaireInt *)
  59 + */
  60 + void visit(ParamDataScalaireInt *) {_operation = new GetClbInfoByIndex<ParamDataScalaireInt>( _process, dynamic_cast<ParamDataScalaireInt &>(_paramData));}
  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("GetClbInfoCreator 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("GetClbInfoCreator 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("GetClbInfoCreator 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("GetClbInfoCreator 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("GetClbInfoCreator 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("GetClbInfoCreator 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("GetClbInfoCreator 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("ParamDataTab2DShort data 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("ParamDataTab2DFloat data 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("ParamDataTab2DDouble data 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("ParamDataTab2DLongDouble data 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("ParamDataTab2DInt data 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("ParamDataTab2DLogicalData data not supported"));
  137 + }
  138 +
  139 + /**
  140 + * @brief get the GetClbInfoByIndex 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 +
  161 +} /* namespace GetClbInfoByIndex */
  162 +} /* namespace AMDA */
  163 +#endif /* GetClbInfoByIndexCREATOR_HH_ */
src/ExternLib/GetClbInfoByIndex/GetClbInfoByIndexProcess.cc 0 โ†’ 100644
@@ -0,0 +1,56 @@ @@ -0,0 +1,56 @@
  1 +/*
  2 + * GetClbInfoByIndexProcess.cc
  3 + *
  4 + * Created on: Sep 24, 2015
  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 "GetClbInfoByIndexProcess.hh"
  16 +#include "GetClbInfoByIndexCreator.hh"
  17 +#include "ParameterCreatorFromExpression.hh"
  18 +
  19 +using namespace std;
  20 +using namespace boost;
  21 +using namespace log4cxx;
  22 +
  23 +namespace AMDA {
  24 +namespace GetClbInfoByIndex {
  25 +
  26 + GetClbInfoByIndexProcess::GetClbInfoByIndexProcess(Parameter &parameter)
  27 + : SingleParamProcess_CRTP(parameter) {
  28 + }
  29 +
  30 + GetClbInfoByIndexProcess::GetClbInfoByIndexProcess(const GetClbInfoByIndexProcess& pProcess, Parameter &parameter)
  31 + : SingleParamProcess_CRTP(pProcess,parameter) {
  32 + }
  33 +
  34 + GetClbInfoByIndexProcess::~GetClbInfoByIndexProcess() {
  35 + }
  36 +
  37 +TimeStamp GetClbInfoByIndexProcess::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 + if (_attributList.size() != 2) {
  44 + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_PROCESS_ERR) << AMDA::ex_msg(std::string("GetClbInfoByIndexProcess::init required at least two attributes. The first one for the clbInfo name, and the second one for size'")));
  45 + }
  46 +
  47 + GetClbInfoByIndexCreator lGetClbInfoByIndexCreator(*this,*_paramInput);
  48 + _operation = lGetClbInfoByIndexCreator.getOperation();
  49 + dynamic_cast<Base::GetClbInfoByIndex*>(_operation)->init(*_parameterInput,_attributList);
  50 + _paramData = ParamDataSPtr(_operation->getParamOutput());
  51 + _paramData->setMinSampling(_paramInput->getMinSampling());
  52 + return timeStamp;
  53 +}
  54 +
  55 +} /* namespace GetClbInfo */
  56 +} /* namespace AMDA */
src/ExternLib/GetClbInfoByIndex/GetClbInfoByIndexProcess.hh 0 โ†’ 100644
@@ -0,0 +1,45 @@ @@ -0,0 +1,45 @@
  1 +/*
  2 + * GetClbInfoByIndexProcess.hh
  3 + *
  4 + * Created on: Sep 24, 2015
  5 + * Author: AKKA
  6 + */
  7 +
  8 +#ifndef GetClbInfoByIndexProcess_HH_
  9 +#define GetClbInfoByIndexProcess_HH_
  10 +
  11 +#include "SingleParamProcess.hh"
  12 +
  13 +namespace AMDA {
  14 +namespace GetClbInfoByIndex {
  15 +
  16 + /**
  17 + * @class GetClbInfoByIndexProcess
  18 + * @brief Return the good Calibration info function to the InputParameter.
  19 + * @details For each time, it put on the Output Param Data the corresponding Calibration Info.
  20 + */
  21 + class GetClbInfoByIndexProcess : public AMDA::Parameters::SingleParamProcess_CRTP<GetClbInfoByIndexProcess> {
  22 + public:
  23 + /**
  24 + * @brief Constructor.
  25 + */
  26 + GetClbInfoByIndexProcess(AMDA::Parameters::Parameter &parameter);
  27 + /**
  28 + * @brief Copy Constructor.
  29 + */
  30 + GetClbInfoByIndexProcess(const GetClbInfoByIndexProcess& pProcess, AMDA::Parameters::Parameter &pParameter) ;
  31 + /**
  32 + * @brief Destructor.
  33 + */
  34 + ~GetClbInfoByIndexProcess();
  35 +
  36 + // Overload Process methods
  37 + /**
  38 + * @overload Process::init()
  39 + */
  40 + AMDA::Parameters::TimeStamp init();
  41 + };
  42 +
  43 +} /* namespace GetClbInfoByIndex */
  44 +} /* namespace AMDA */
  45 +#endif /* GetClbInfoByIndexProcess_HH_ */
src/Info/ParamTable.cc
@@ -209,8 +209,16 @@ t_TableBound ParamCenterTable::getBound(ParameterManager *parameterManager, unsi @@ -209,8 +209,16 @@ t_TableBound ParamCenterTable::getBound(ParameterManager *parameterManager, unsi
209 return bound; 209 return bound;
210 } 210 }
211 211
212 - bound.min = centersValues[index] - _size/2.;  
213 - bound.max = centersValues[index] + _size/2.;; 212 + if (!std::isnan(centersValues[index]))
  213 + {
  214 + bound.min = centersValues[index] - _size/2.;
  215 + bound.max = centersValues[index] + _size/2.;
  216 + }
  217 + else
  218 + {
  219 + bound.min = NAN;
  220 + bound.max = NAN;
  221 + }
214 222
215 return bound; 223 return bound;
216 } 224 }
@@ -258,8 +266,16 @@ t_TableBound ParamCenterWidthTable::getBound(ParameterManager *parameterManager, @@ -258,8 +266,16 @@ t_TableBound ParamCenterWidthTable::getBound(ParameterManager *parameterManager,
258 return bound; 266 return bound;
259 } 267 }
260 268
261 - bound.min = centersValues[index] - widthsValues[index]/2.;  
262 - bound.max = centersValues[index] + widthsValues[index]/2.;; 269 + if (!std::isnan(centersValues[index]) && !std::isnan(widthsValues[index]))
  270 + {
  271 + bound.min = centersValues[index] - widthsValues[index]/2.;
  272 + bound.max = centersValues[index] + widthsValues[index]/2.;
  273 + }
  274 + else
  275 + {
  276 + bound.min = NAN;
  277 + bound.max = NAN;
  278 + }
263 279
264 return bound; 280 return bound;
265 } 281 }
@@ -320,18 +336,28 @@ t_TableBound ParamCenterAutoTable::getBound(ParameterManager *parameterManager, @@ -320,18 +336,28 @@ t_TableBound ParamCenterAutoTable::getBound(ParameterManager *parameterManager,
320 336
321 if (index == 0) 337 if (index == 0)
322 { 338 {
323 - if (_log)  
324 - plus = (log10(centersValues[1]) - log10(centersValues[0]))/2.; 339 + if (!std::isnan(centersValues[1]) && !std::isnan(centersValues[0]))
  340 + {
  341 + if (_log)
  342 + plus = (log10(centersValues[1]) - log10(centersValues[0]))/2.;
  343 + else
  344 + plus = (centersValues[1] - centersValues[0])/2.;
  345 + }
325 else 346 else
326 - plus = (centersValues[1] - centersValues[0])/2.; 347 + plus = NAN;
327 minus = plus; 348 minus = plus;
328 } 349 }
329 else if (index == centersValues.size() - 1) 350 else if (index == centersValues.size() - 1)
330 { 351 {
331 - if (_log)  
332 - minus = (log10(centersValues[centersValues.size() - 1]) - log10(centersValues[centersValues.size() - 2]))/2.; 352 + if (!std::isnan(centersValues[centersValues.size() - 1]) && !std::isnan(centersValues[centersValues.size() - 2]))
  353 + {
  354 + if (_log)
  355 + minus = (log10(centersValues[centersValues.size() - 1]) - log10(centersValues[centersValues.size() - 2]))/2.;
  356 + else
  357 + minus = (centersValues[centersValues.size() - 1] - centersValues[centersValues.size() - 2])/2.;
  358 + }
333 else 359 else
334 - minus = (centersValues[centersValues.size() - 1] - centersValues[centersValues.size() - 2])/2.; 360 + minus = NAN;
335 plus = minus; 361 plus = minus;
336 362
337 } 363 }
@@ -339,25 +365,49 @@ t_TableBound ParamCenterAutoTable::getBound(ParameterManager *parameterManager, @@ -339,25 +365,49 @@ t_TableBound ParamCenterAutoTable::getBound(ParameterManager *parameterManager,
339 { 365 {
340 if (_log) 366 if (_log)
341 { 367 {
342 - minus = (log10(centersValues[index]) - log10(centersValues[index-1]))/2.;  
343 - plus = (log10(centersValues[index+1]) - log10(centersValues[index]))/2.; 368 + if (!std::isnan(centersValues[index]) && !std::isnan(centersValues[index-1]) && (centersValues[index] > 0) && (centersValues[index-1] > 0))
  369 + minus = (log10(centersValues[index]) - log10(centersValues[index-1]))/2.;
  370 + else
  371 + minus = NAN;
  372 + if (!std::isnan(centersValues[index+1]) && !std::isnan(centersValues[index]) && (centersValues[index+1] > 0) && (centersValues[index] > 0))
  373 + plus = (log10(centersValues[index+1]) - log10(centersValues[index]))/2.;
  374 + else
  375 + plus = NAN;
344 } 376 }
345 else 377 else
346 { 378 {
347 - minus = (centersValues[index] - centersValues[index-1])/2.;  
348 - plus = (centersValues[index+1] - centersValues[index])/2.; 379 + if (!std::isnan(centersValues[index]) && !std::isnan(centersValues[index-1]))
  380 + minus = (centersValues[index] - centersValues[index-1])/2.;
  381 + else
  382 + minus = NAN;
  383 + if (!std::isnan(centersValues[index+1]) && !std::isnan(centersValues[index]))
  384 + plus = (centersValues[index+1] - centersValues[index])/2.;
  385 + else
  386 + plus = NAN;
349 } 387 }
350 } 388 }
351 389
352 if (_log) 390 if (_log)
353 { 391 {
354 - bound.min = exp(log10(centersValues[index]) - minus);  
355 - bound.max = exp(log10(centersValues[index]) + plus); 392 + if (!std::isnan(minus))
  393 + bound.min = exp(log10(centersValues[index]) - minus);
  394 + else
  395 + bound.min = NAN;
  396 + if (!std::isnan(plus))
  397 + bound.max = exp(log10(centersValues[index]) + plus);
  398 + else
  399 + bound.max = NAN;
356 } 400 }
357 else 401 else
358 { 402 {
359 - bound.min = centersValues[index] - minus;  
360 - bound.max = centersValues[index] + plus; 403 + if (!std::isnan(minus))
  404 + bound.min = centersValues[index] - minus;
  405 + else
  406 + bound.min = NAN;
  407 + if (!std::isnan(plus))
  408 + bound.max = centersValues[index] + plus;
  409 + else
  410 + bound.max = NAN;
361 } 411 }
362 412
363 if (bound.min > bound.max) 413 if (bound.min > bound.max)
src/InternLib/Resampling.hh
@@ -141,6 +141,9 @@ public: @@ -141,6 +141,9 @@ public:
141 if ((pParamDataIndexInfo._nbDataToProcess > 0)) { 141 if ((pParamDataIndexInfo._nbDataToProcess > 0)) {
142 //init _val with the first data value (to init dimensions) 142 //init _val with the first data value (to init dimensions)
143 _val = _paramInput.get(pParamDataIndexInfo._startIndex); 143 _val = _paramInput.get(pParamDataIndexInfo._startIndex);
  144 + _nearestValue = _paramInput.get(pParamDataIndexInfo._startIndex);
  145 + _val << NotANumber();
  146 + _nearestValue << NotANumber();
144 147
145 switch (_samplingMode) 148 switch (_samplingMode)
146 { 149 {
src/ParamOutputImpl/Plot/Time/TimePlot.cc
@@ -283,8 +283,16 @@ void TimePlot::configureSpectroAxis() { @@ -283,8 +283,16 @@ void TimePlot::configureSpectroAxis() {
283 for (int i = 0; i < parameterDimension; ++i) 283 for (int i = 0; i < parameterDimension; ++i)
284 { 284 {
285 crtBound = tableSPtr->getBound(&_parameterManager, i); 285 crtBound = tableSPtr->getBound(&_parameterManager, i);
286 - lYAxisRange.setMin(std::min(crtBound.min,lYAxisRange.getMin()));  
287 - lYAxisRange.setMax(std::max(crtBound.max,lYAxisRange.getMax())); 286 + if (!std::isnan(crtBound.min))
  287 + {
  288 + if (!((lYAxis->_scale == Axis::Scale::LOGARITHMIC) && (crtBound.min <= 0)))
  289 + lYAxisRange.setMin(std::min(crtBound.min,lYAxisRange.getMin()));
  290 + }
  291 + if (!std::isnan(crtBound.max))
  292 + {
  293 + if (!((lYAxis->_scale == Axis::Scale::LOGARITHMIC) && (crtBound.max <= 0)))
  294 + lYAxisRange.setMax(std::max(crtBound.max,lYAxisRange.getMax()));
  295 + }
288 } 296 }
289 } 297 }
290 else 298 else
@@ -299,7 +307,7 @@ void TimePlot::configureSpectroAxis() { @@ -299,7 +307,7 @@ void TimePlot::configureSpectroAxis() {
299 std::vector<double> paramTableValues; 307 std::vector<double> paramTableValues;
300 for (int j = 0; j < data.getDim1Size(); ++j) 308 for (int j = 0; j < data.getDim1Size(); ++j)
301 { 309 {
302 - double* values = data.getValues(AMDA::Common::ParameterIndexComponent(j,-1), i); 310 + double* values = data.getValues(AMDA::Common::ParameterIndexComponent(j), i);
303 paramTableValues.push_back((*values)); 311 paramTableValues.push_back((*values));
304 } 312 }
305 paramsTableData[it->first] = paramTableValues; 313 paramsTableData[it->first] = paramTableValues;
@@ -307,8 +315,16 @@ void TimePlot::configureSpectroAxis() { @@ -307,8 +315,16 @@ void TimePlot::configureSpectroAxis() {
307 for (int j = 0; j < parameterDimension; ++j) 315 for (int j = 0; j < parameterDimension; ++j)
308 { 316 {
309 crtBound = tableSPtr->getBound(&_parameterManager, j, &paramsTableData); 317 crtBound = tableSPtr->getBound(&_parameterManager, j, &paramsTableData);
310 - lYAxisRange.setMin(std::min(crtBound.min,lYAxisRange.getMin()));  
311 - lYAxisRange.setMax(std::max(crtBound.max,lYAxisRange.getMax())); 318 + if (!std::isnan(crtBound.min))
  319 + {
  320 + if (!((lYAxis->_scale == Axis::Scale::LOGARITHMIC) && (crtBound.min <= 0)))
  321 + lYAxisRange.setMin(std::min(crtBound.min,lYAxisRange.getMin()));
  322 + }
  323 + if (!std::isnan(crtBound.max))
  324 + {
  325 + if (!((lYAxis->_scale == Axis::Scale::LOGARITHMIC) && (crtBound.max <= 0)))
  326 + lYAxisRange.setMax(std::max(crtBound.max,lYAxisRange.getMax()));
  327 + }
312 } 328 }
313 } 329 }
314 } 330 }
@@ -944,12 +960,16 @@ void TimePlot::drawSpectro(double startDate, double stopDate, std::string pParam @@ -944,12 +960,16 @@ void TimePlot::drawSpectro(double startDate, double stopDate, std::string pParam
944 crtBound = tableSPtr->getBound(&_parameterManager, index.getDim1Index()); 960 crtBound = tableSPtr->getBound(&_parameterManager, index.getDim1Index());
945 else 961 else
946 crtBound = tableSPtr->getBound(&_parameterManager, index.getDim2Index()); 962 crtBound = tableSPtr->getBound(&_parameterManager, index.getDim2Index());
  963 + if (std::isnan(crtBound.min) || std::isnan(crtBound.max))
  964 + continue;
947 part.y[0] = crtBound.min; 965 part.y[0] = crtBound.min;
948 part.y[1] = crtBound.max; 966 part.y[1] = crtBound.max;
949 if (lYAxis->_scale == Axis::Scale::LOGARITHMIC) 967 if (lYAxis->_scale == Axis::Scale::LOGARITHMIC)
950 { 968 {
951 - part.y[0] = ((part.y[0] > 0) ? log10(part.y[0]) : 10e-3);  
952 - part.y[1] = ((part.y[1] > 0) ? log10(part.y[1]) : 10e-3); 969 + if ((crtBound.min <= 0) || (crtBound.max <= 0))
  970 + continue;
  971 + part.y[0] = log10(part.y[0]);
  972 + part.y[1] = log10(part.y[1]);
953 } 973 }
954 } 974 }
955 975
@@ -1010,13 +1030,21 @@ void TimePlot::drawSpectro(double startDate, double stopDate, std::string pParam @@ -1010,13 +1030,21 @@ void TimePlot::drawSpectro(double startDate, double stopDate, std::string pParam
1010 1030
1011 part.y[0] = crtBound.min; 1031 part.y[0] = crtBound.min;
1012 part.y[1] = crtBound.max; 1032 part.y[1] = crtBound.max;
1013 - if (lYAxis->_scale == Axis::Scale::LOGARITHMIC) 1033 +
  1034 + if (!std::isnan(crtBound.min) && !std::isnan(crtBound.max))
1014 { 1035 {
1015 - part.y[0] = ((part.y[0] > 0) ? log10(part.y[0]) : 10e-3);  
1016 - part.y[1] = ((part.y[1] > 0) ? log10(part.y[1]) : 10e-3); 1036 + if (lYAxis->_scale == Axis::Scale::LOGARITHMIC)
  1037 + {
  1038 + if ((crtBound.min > 0) && (crtBound.max > 0))
  1039 + {
  1040 + part.y[0] = log10(part.y[0]);
  1041 + part.y[1] = log10(part.y[1]);
  1042 + matrixGrid.push_back(part);
  1043 + }
  1044 + }
  1045 + else
  1046 + matrixGrid.push_back(part);
1017 } 1047 }
1018 -  
1019 - matrixGrid.push_back(part);  
1020 } 1048 }
1021 } 1049 }
1022 } 1050 }