Commit d98b5533cc7da6bed46e1290ec7671b9074b6b8e

Authored by Elena.Budnik
1 parent 6a1c196c

new curves/constants

src/Common/AMDA_constants.hh
... ... @@ -8,8 +8,14 @@
8 8 #ifndef AMDA_CONSTANTS_HH_
9 9 #define AMDA_CONSTANTS_HH_
10 10  
11   -#define RADIUS_VENUS 6052. //km
  11 +// all radii in km
  12 +#define RADIUS_MERCURY 2440.
  13 +#define RADIUS_VENUS 6052.
  14 +#define RADIUS_EARTH 6371.
  15 +#define RADIUS_MARS 3396.
  16 +#define RADIUS_JUPITER 71492.
  17 +#define RADIUS_SATURN 60286.
  18 +
12 19 #define MK2Ev 86.2069
13 20  
14 21 #endif /* AMDA_CONSTANTS_HH_ */
15   -
... ...
src/ExternLib/PlotCurves/AMDAPlugin.cc
... ... @@ -53,6 +53,7 @@ DESCRIPTION
53 53 #include "ServicesServer.hh"
54 54 #include "PluginManager.hh"
55 55 #include "CurveFunctionWriter.hh"
  56 +#include "BowShock.hh"
56 57  
57 58 #include <math.h>
58 59  
... ... @@ -63,53 +64,6 @@ using namespace plot;
63 64 //-----------------------------------------------------------------------------
64 65  
65 66 /**
66   - * @details This procedure return the curve definition of venus bowshock.
67   - */
68   -void venus_bowshock(double precision, CurveFunctionWriter::AttributeList& pAttributeList, CurveFunctionWriter::CurvePointList& curvePointList)
69   -{
70   - //param1 = 145.
71   - CurveFunctionWriter::AttributeList::iterator lparam1It = pAttributeList.find("param1");
72   - if ( lparam1It == pAttributeList.end())
73   - {
74   - BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_INFORMATION_REQUEST_ERR) << AMDA::ex_msg(std::string("venus_bowshock not found param1 attribute")));
75   - }
76   -
77   - //param2 = 1.35
78   - CurveFunctionWriter::AttributeList::iterator lparam2It = pAttributeList.find("param2");
79   - if ( lparam2It == pAttributeList.end())
80   - {
81   - BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_INFORMATION_REQUEST_ERR) << AMDA::ex_msg(std::string("venus_bowshock not found param2 attribute")));
82   - }
83   -
84   - //param3 = 1.18
85   - CurveFunctionWriter::AttributeList::iterator lparam3It = pAttributeList.find("param3");
86   - if ( lparam3It == pAttributeList.end())
87   - {
88   - BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_INFORMATION_REQUEST_ERR) << AMDA::ex_msg(std::string("venus_bowshock not found param3 attribute")));
89   - }
90   -
91   - //param4 = 0.55
92   - CurveFunctionWriter::AttributeList::iterator lparam4It = pAttributeList.find("param4");
93   - if ( lparam4It == pAttributeList.end())
94   - {
95   - BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_INFORMATION_REQUEST_ERR) << AMDA::ex_msg(std::string("venus_bowshock not found param4 attribute")));
96   - }
97   -
98   - double theta, rr;
99   - for (int i = 0; i < precision; ++i)
100   - {
101   - theta = (lparam1It->second * M_PI / 180.) * (double)(((double)i) / precision);
102   - rr = lparam2It->second / (1.0 + lparam3It->second * cos(theta));
103   - CurveFunctionWriter::CurvePoint point;
104   - point.x = lparam4It->second + rr * cos(theta);
105   - point.y = rr * sin(theta);
106   - point.z = point.y;
107   - //std::cout << "BRE - " << point.x << " - " << point.y << " - " << point.z << std::endl;
108   - curvePointList.push_back(point);
109   - }
110   -}
111   -
112   -/**
113 67 * @details This procedure return the curve definition of venus magnetopause.
114 68 */
115 69 void venus_magnetopause(double precision, CurveFunctionWriter::AttributeList& pAttributeList, CurveFunctionWriter::CurvePointList& curvePointList)
... ... @@ -207,6 +161,7 @@ extern &quot;C&quot; const char* getPluginVersion()
207 161 */
208 162 extern "C" void registerPlugin(AMDA::Plugins::PluginManager & /*pm*/)
209 163 {
  164 + ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("mars_bowshock",&mars_bowshock);
210 165 ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("venus_bowshock",&venus_bowshock);
211 166 ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("venus_magnetopause",&venus_magnetopause);
212 167 ServicesServer::getInstance()->addServiceImpl<CurveFunctionWriter::CurveFunctionProcess>("circle",&circle);
... ...
src/ExternLib/PlotCurves/BowShock.cc 0 → 100644
... ... @@ -0,0 +1,127 @@
  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 "DicError.hh"
  52 +#include "AMDA_exception.hh"
  53 +#include "ServicesServer.hh"
  54 +#include "PluginManager.hh"
  55 +#include "CurveFunctionWriter.hh"
  56 +#include "BowShock.hh"
  57 +
  58 +#include <math.h>
  59 +
  60 +using namespace AMDA::Parameters;
  61 +using namespace plot;
  62 +
  63 +// Other modules include files
  64 +//-----------------------------------------------------------------------------
  65 +
  66 +void venus_bowshock(double precision, CurveFunctionWriter::AttributeList& pAttributeList, CurveFunctionWriter::CurvePointList& curvePointList)
  67 +{
  68 + // param1 = 145.0 degrees
  69 + // param2 = 1.35 Rv
  70 + // param3 = 1.18
  71 + // param4 = 0.55 Rv
  72 + bowshock(precision, pAttributeList, curvePointList);
  73 +}
  74 +
  75 +void mars_bowshock(double precision, CurveFunctionWriter::AttributeList& pAttributeList, CurveFunctionWriter::CurvePointList& curvePointList)
  76 +{
  77 + // param1 = 135.0 degrees
  78 + // param2 = 2.04 Rm
  79 + // param3 = 1.02
  80 + // param4 = 0.55 Rm
  81 + bowshock(precision, pAttributeList, curvePointList);
  82 +}
  83 +/**
  84 + * @details This procedure return the curve definition of general bowshock
  85 + * r = L/(1+epsilon*cos(theta))
  86 + */
  87 +void bowshock(double precision, CurveFunctionWriter::AttributeList& pAttributeList, CurveFunctionWriter::CurvePointList& curvePointList)
  88 +{
  89 + CurveFunctionWriter::AttributeList::iterator lparam1It = pAttributeList.find("param1");
  90 + if ( lparam1It == pAttributeList.end())
  91 + {
  92 + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_INFORMATION_REQUEST_ERR) << AMDA::ex_msg(std::string("venus_bowshock not found param1 attribute")));
  93 + }
  94 +
  95 + CurveFunctionWriter::AttributeList::iterator lparam2It = pAttributeList.find("param2");
  96 + if ( lparam2It == pAttributeList.end())
  97 + {
  98 + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_INFORMATION_REQUEST_ERR) << AMDA::ex_msg(std::string("venus_bowshock not found param2 attribute")));
  99 + }
  100 +
  101 + CurveFunctionWriter::AttributeList::iterator lparam3It = pAttributeList.find("param3");
  102 + if ( lparam3It == pAttributeList.end())
  103 + {
  104 + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_INFORMATION_REQUEST_ERR) << AMDA::ex_msg(std::string("venus_bowshock not found param3 attribute")));
  105 + }
  106 +
  107 + CurveFunctionWriter::AttributeList::iterator lparam4It = pAttributeList.find("param4");
  108 + if ( lparam4It == pAttributeList.end())
  109 + {
  110 + BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_INFORMATION_REQUEST_ERR) << AMDA::ex_msg(std::string("venus_bowshock not found param4 attribute")));
  111 + }
  112 +
  113 + double theta, rr;
  114 + for (int i = 0; i < precision; ++i)
  115 + {
  116 + theta = (lparam1It->second * M_PI / 180.) * (double)(((double)i) / precision);
  117 + rr = lparam2It->second / (1.0 + lparam3It->second * cos(theta));
  118 + CurveFunctionWriter::CurvePoint point;
  119 + point.x = lparam4It->second + rr * cos(theta);
  120 + point.y = rr * sin(theta);
  121 + point.z = point.y;
  122 + //std::cout << "BRE - " << point.x << " - " << point.y << " - " << point.z << std::endl;
  123 + curvePointList.push_back(point);
  124 + }
  125 +}
  126 +
  127 +
... ...
src/ExternLib/PlotCurves/BowShock.hh 0 → 100644
... ... @@ -0,0 +1,18 @@
  1 +/**
  2 + * AMDAPlugin.hh
  3 + *
  4 + * Created on:
  5 + * Author:
  6 + */
  7 +
  8 +#ifndef BOWSHOCK_HH_
  9 +#define BOWSHOCK_HH_
  10 +
  11 +using namespace plot;
  12 +
  13 +void venus_bowshock(double precision, CurveFunctionWriter::AttributeList& pAttributeList, CurveFunctionWriter::CurvePointList& curvePointList);
  14 +void mars_bowshock(double precision, CurveFunctionWriter::AttributeList& pAttributeList, CurveFunctionWriter::CurvePointList& curvePointList);
  15 +
  16 +void bowshock(double precision, CurveFunctionWriter::AttributeList& pAttributeList, CurveFunctionWriter::CurvePointList& curvePointList);
  17 +
  18 +#endif /* BOWSHOCK_HH_*/
... ...