12#ifndef SOSM_SCALARTABLE2D_HPP
13#define SOSM_SCALARTABLE2D_HPP
22#include "TblLookup.hpp"
27 using TablePtr = std::shared_ptr<SOSM_ScalarTable2D>;
35 const std::string& aFileName,
36 const std::string& aCachePrefix,
43 const std::vector<float>&
DV()
const {
return mDV; }
46 std::vector<float>&
DV() {
return mDV; }
49 const TblIndVarU<float>&
IV1()
const {
return mIV1; }
52 TblIndVarU<float>&
IV1() {
return mIV1; }
55 const TblIndVarU<float>&
IV2()
const {
return mIV2; }
58 TblIndVarU<float>&
IV2() {
return mIV2; }
69 float Interpolate(
const TblLookupL<float>& aIV1_Lookup,
const TblLookupL<float>& aIV2_Lookup)
const;
76 void PolarLookup(TblLookupLU<float>& aAzLookup, TblLookupLU<float>& aElLookup,
float aAzimuth,
float aElevation)
const
79 float tempAzimuth = aAzimuth;
80 if ((aAzimuth < 0.0F) && (mIV1.Get(0) >= 0.0F))
82 tempAzimuth = -aAzimuth;
84 aAzLookup.Lookup(mIV1, tempAzimuth);
85 aElLookup.Lookup(mIV2, aElevation);
88 void Load(
const std::string& aFileName,
const std::string& aCachePrefix);
97 void ValidateAndScale_IV(TblIndVarU<float>& aIV,
const SOSM_TableVar& aIV_Info);
102 std::string mFileName;
105 double mModificationTime;
108 std::string mUserIdent[3];
112 std::vector<float> mDV;
116 TblIndVarU<float> mIV1;
120 TblIndVarU<float> mIV2;
132 typedef std::map<std::string, TablePtr> TableMap;
135 static TableMap sSharedPolarTables;
A singleton class that manages SOSM data.
Definition SOSM_Manager.hpp:32
void PolarLookup(TblLookupLU< float > &aAzLookup, TblLookupLU< float > &aElLookup, float aAzimuth, float aElevation) const
Definition SOSM_ScalarTable2D.hpp:76
std::vector< float > & DV()
Return the dependent variable (non-const form).
Definition SOSM_ScalarTable2D.hpp:46
float Interpolate(const TblLookupL< float > &aIV1_Lookup, const TblLookupL< float > &aIV2_Lookup) const
Definition SOSM_ScalarTable2D.cpp:234
TblIndVarU< float > & IV1()
Return the independent variable 1 values (non-const form).
Definition SOSM_ScalarTable2D.hpp:52
void LoadBinaryFile(const std::string &aFileName)
Definition SOSM_ScalarTable2D.cpp:190
TblIndVarU< float > & IV2()
Return the independent variable 2 values (non-const form).
Definition SOSM_ScalarTable2D.hpp:58
double GetModificationTime() const
Return when the source file from which the object was recreated was last modified.
Definition SOSM_ScalarTable2D.hpp:40
const TblIndVarU< float > & IV1() const
Return the independent variable 1 values (const form).
Definition SOSM_ScalarTable2D.hpp:49
SOSM_ScalarTable2D(SOSM_Manager *aManagerPtr)
Definition SOSM_ScalarTable2D.cpp:29
const std::vector< float > & DV() const
Return the dependent variable (const form).
Definition SOSM_ScalarTable2D.hpp:43
void SetIV1_Info(const SOSM_TableVar &aIV1_Info)
Set the name, limits and scale for independent variable 1.
Definition SOSM_ScalarTable2D.hpp:64
void LoadTextFile(const std::string &aFileName)
Definition SOSM_ScalarTable2D.cpp:98
void SetDV_Info(const SOSM_TableVar &aDV_Info)
Set the name, limits and scale for the dependent variable.
Definition SOSM_ScalarTable2D.hpp:61
static TablePtr LoadSharedPolarTable(SOSM_Manager *aManagerPtr, const std::string &aFileName, const std::string &aCachePrefix, const SOSM_TableVar &aDV_Info)
Definition SOSM_ScalarTable2D.cpp:36
const TblIndVarU< float > & IV2() const
Return the independent variable 2 values (const form).
Definition SOSM_ScalarTable2D.hpp:55
void SaveBinaryFile(const std::string &aFileName)
Definition SOSM_ScalarTable2D.cpp:214
void SetIV2_Info(const SOSM_TableVar &aIV2_Info)
Set the name, limits and scale for independent variable 2.
Definition SOSM_ScalarTable2D.hpp:67
void Load(const std::string &aFileName, const std::string &aCachePrefix)
Definition SOSM_ScalarTable2D.cpp:61
std::shared_ptr< SOSM_ScalarTable2D > TablePtr
Definition SOSM_ScalarTable2D.hpp:27
A helper class for specifying data to the table loaders.
Definition SOSM_TableVar.hpp:17