forked from ngageoint/csm
-
Notifications
You must be signed in to change notification settings - Fork 13
/
RasterGM.cpp
143 lines (121 loc) · 4.65 KB
/
RasterGM.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
//#############################################################################
//
// FILENAME: RasterGM.cpp
//
// CLASSIFICATION: Unclassified
//
// DESCRIPTION:
//
// This file provides implementation for methods declared in the
// RasterGM class.
//
// SOFTWARE HISTORY:
// Date Author Comment
// ----------- ------ -------
// 06-Dec-2012 JPK Initial Coding
// Changed ParamSet to param::Set. De-inlined
// destructor and getFamily() methods.
// Replaced vector<double> with EcefLocus for
// imageTo*Locus methods. Added inline method
// getCovarianceMatrix(). Provided reference
// implementations for computeAllSensorPartials()
// methods.
// 17-Dec-2012 BAH Documentation updates.
//
// NOTES:
//
// Refer to RasterGM.h for more information.
//
//#############################################################################
#define CSM_LIBRARY
#include "RasterGM.h"
namespace csm {
//*****************************************************************************
// RasterGM::~RasterGM()
//*****************************************************************************
RasterGM::~RasterGM()
{}
//*****************************************************************************
// RasterGM::getFamily()
//*****************************************************************************
std::string RasterGM::getFamily() const
{
return (GeometricModel::getFamily() + CSM_RASTER_FAMILY);
}
//*****************************************************************************
// RasterGM::computeAllSensorPartials()
//*****************************************************************************
std::vector<RasterGM::SensorPartials>
RasterGM::computeAllSensorPartials(const EcefCoord& groundPt,
param::Set pSet,
double desiredPrecision,
double* achievedPrecision,
WarningList* warnings) const
{
const std::vector<int> indices = getParameterSetIndices(pSet);
std::vector<RasterGM::SensorPartials> val;
const int NUM_PARAMS = indices.size();
if (NUM_PARAMS)
{
val.resize(NUM_PARAMS);
//***
// The achieved precision should be the MAXIMUM of the achieved
// precision values found for each desired index.
//***
if (achievedPrecision) *achievedPrecision = 0.0;
for(int i = 0; i < NUM_PARAMS; ++i)
{
double prec = 0.0;
val[i] = computeSensorPartials(indices[i],
groundPt,
desiredPrecision,
&prec,
warnings);
if (achievedPrecision && (prec > *achievedPrecision))
{
*achievedPrecision = prec;
}
}
}
return val;
}
//*****************************************************************************
// RasterGM::computeAllSensorPartials()
//*****************************************************************************
std::vector<RasterGM::SensorPartials>
RasterGM::computeAllSensorPartials(const ImageCoord& imagePt,
const EcefCoord& groundPt,
param::Set pSet,
double desiredPrecision,
double* achievedPrecision,
WarningList* warnings) const
{
const std::vector<int> indices = getParameterSetIndices(pSet);
std::vector<RasterGM::SensorPartials> val;
const int NUM_PARAMS = indices.size();
if (NUM_PARAMS)
{
val.resize(NUM_PARAMS);
//***
// The achieved precision should be the MAXIMUM of the achieved
// precision values found for each desired index.
//***
if (achievedPrecision) *achievedPrecision = 0.0;
for(int i = 0; i < NUM_PARAMS; ++i)
{
double prec = 0.0;
val[i] = computeSensorPartials(indices[i],
imagePt,
groundPt,
desiredPrecision,
&prec,
warnings);
if (achievedPrecision && (prec > *achievedPrecision))
{
*achievedPrecision = prec;
}
}
}
return val;
}
} // namespace csm