WSF
WsfOpticalPath.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2003-2015 The Boeing Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef WSFOPTICALPATH_HPP
13#define WSFOPTICALPATH_HPP
14
15#include "wsf_mil_export.h"
16
17#include <string>
18#include <vector>
19
20class Integrand;
21#include "UtGenericMappedList.hpp"
22#include "UtIntegrand.hpp"
23class UtInput;
24class WsfEM_Xmtr;
26class WsfScenario;
27
34class WSF_MIL_EXPORT WsfOpticalPath
35{
36public:
38 WsfOpticalPath(); // Use for deferred initialization of coefficients
40 unsigned aWavelength,
41 unsigned aAtmosphereModel = 2,
42 unsigned aHazeMode = 1);
43
44 class Coefficients;
45
46 WsfOpticalPath(const WsfOpticalPath::Coefficients* aCoefficientsPtr); // For use with legacy code.
47
48 virtual ~WsfOpticalPath() = default;
49
50 enum Type
51 {
55 };
56
57 bool Initialize(WsfOpticalPathCoefficientTypes& aTypes,
58 unsigned aWavelength_nm,
59 unsigned aAtmosphereModel = 2,
60 unsigned aHazeModel = 1);
61
62 double GetAttenuation(double aSlantRange, double aTargetHeight, double aShootHeight);
63
66 class WSF_MIL_EXPORT Coefficients
67 {
68 public:
69 Coefficients() = default;
70 virtual ~Coefficients() = default;
71
72 // virtual Coefficients* Clone() const = 0;
73
74 virtual double GetExtinction(double aAltitude, Type aType = cBOTH) const = 0;
75 };
76
77
81 class WSF_MIL_EXPORT LaserCoefficients : public Coefficients
82 {
83 public:
86 ~LaserCoefficients() override = default;
87
88 const Coefficients& GetCoefficients(const std::string& aWavelength_nm,
89 unsigned aAtmosphereModel = 2,
90 unsigned aHazeModel = 1);
91
92 double GetExtinction(double aAltitude, Type aType) const override;
93
95 const std::vector<double>& GetAltitudes() const { return mAltitude; }
96 const std::vector<double>& GetAttenuationCoefficients() const { return mAbs; }
97 const std::vector<double>& GetScatteringCoefficients() const { return mScat; }
98
99 protected:
100 private:
102
103 double mWavelength;
104 int mAtmosphereModel;
113 int mHazeModel;
122 std::vector<double> mAltitude;
123 std::vector<double> mAbs;
124 std::vector<double> mScat;
125 };
126
129 class WSF_MIL_EXPORT Integrand : public UtIntegrand
130 {
131 public:
132 Integrand(double aSlantRange, double aTargetHeight, double aPlatformHeight, const Coefficients& aCoeffs, Type aType)
133 : mSlantRange(aSlantRange)
134 , mTargetHeight(aTargetHeight)
135 , mPlatformHeight(aPlatformHeight)
136 , mCoeffs(aCoeffs)
137 , mType(aType)
138 {
139 }
140
141 double Function(double aRange) override;
142
143 private:
144 double Height(double aRangeFromPlatform, double aTotalSlantRange, double aTargetHeight, double aPlatformHeight);
145
146 double mSlantRange;
147 double mTargetHeight;
148 double mPlatformHeight;
149 const Coefficients& mCoeffs;
150 Type mType;
151 };
152
154 double aWavelength,
155 unsigned aAtmosphereModel = 2,
156 unsigned aHazeMode = 1);
157
158private:
159 const Coefficients* mCoeffsPtr;
160};
161
163{
164public:
166
167 static WSF_MIL_EXPORT WsfOpticalPathCoefficientTypes& Get(WsfScenario& aScenario);
168 static WSF_MIL_EXPORT const WsfOpticalPathCoefficientTypes& Get(const WsfScenario& aScenario);
170
172
173 WSF_MIL_EXPORT bool LoadType(UtInput& aInput);
174
175 WSF_MIL_EXPORT const Coefficients& GetCoefficients(unsigned aWavelength_nm,
176 unsigned aAtmosphereModel = 2,
177 unsigned aHazeModel = 1) const;
178
179 WSF_MIL_EXPORT const Coefficients& GetCoefficients(double aWavelength,
180 unsigned aAtmosphereModel = 2,
181 unsigned aHazeModel = 1) const;
182
183private:
184 UtStdMappedList<Coefficients, std::string> mCoeffs;
185};
186#endif
An abstract base class for sensor_plot function.
Definition Function.hpp:29
Definition WsfEM_Xmtr.hpp:55
Definition WsfOpticalPath.hpp:163
static WSF_MIL_EXPORT WsfOpticalPathCoefficientTypes & Get(WsfScenario &aScenario)
Return a modifiable reference to the type list associated with the specified scenario.
Definition WsfOpticalPath.cpp:201
WSF_MIL_EXPORT bool LoadType(UtInput &aInput)
Definition WsfOpticalPath.cpp:246
WSF_MIL_EXPORT const Coefficients & GetCoefficients(unsigned aWavelength_nm, unsigned aAtmosphereModel=2, unsigned aHazeModel=1) const
Convert parameters to a string in order to find the coefficient table.
Definition WsfOpticalPath.cpp:216
WsfOpticalPath::LaserCoefficients Coefficients
Definition WsfOpticalPath.hpp:171
Definition WsfOpticalPath.hpp:67
virtual ~Coefficients()=default
virtual double GetExtinction(double aAltitude, Type aType=cBOTH) const =0
Integrand(double aSlantRange, double aTargetHeight, double aPlatformHeight, const Coefficients &aCoeffs, Type aType)
Definition WsfOpticalPath.hpp:132
Definition WsfOpticalPath.hpp:82
friend class WsfOpticalPathCoefficientTypes
Definition WsfOpticalPath.hpp:84
double GetExtinction(double aAltitude, Type aType) const override
Definition WsfOpticalPath.cpp:117
const Coefficients & GetCoefficients(const std::string &aWavelength_nm, unsigned aAtmosphereModel=2, unsigned aHazeModel=1)
const std::vector< double > & GetAttenuationCoefficients() const
Definition WsfOpticalPath.hpp:96
LaserCoefficients()
Definition WsfOpticalPath.cpp:101
const std::vector< double > & GetScatteringCoefficients() const
Definition WsfOpticalPath.hpp:97
friend class WsfOpticalAttenuation
Definition WsfOpticalPath.hpp:101
~LaserCoefficients() override=default
const std::vector< double > & GetAltitudes() const
The following are necessary to copy into simple arrays with DynamicSpear.
Definition WsfOpticalPath.hpp:95
Definition WsfOpticalPath.hpp:35
friend class WsfOpticalPathCoefficientTypes
Definition WsfOpticalPath.hpp:37
WsfOpticalPath()
Definition WsfOpticalPath.cpp:26
Type
Definition WsfOpticalPath.hpp:51
@ cBOTH
scattering only
Definition WsfOpticalPath.hpp:54
@ cABS
Definition WsfOpticalPath.hpp:52
@ cSCAT
absorption only
Definition WsfOpticalPath.hpp:53
virtual ~WsfOpticalPath()=default
Contains the data required to create a simulation, and acts as the entry point for input file process...
Definition WsfScenario.hpp:111
Copyrights Multiple, All Rights Reserved