OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Protected Attributes | List of all members
ossimplugins::RadarSat2NoiseLevel Class Reference

This class represents an Noise. More...

#include <RadarSat2NoiseLevel.h>

Public Member Functions

 RadarSat2NoiseLevel ()
 Constructor. More...
 
virtual ~RadarSat2NoiseLevel ()
 Destructor. More...
 
 RadarSat2NoiseLevel (const RadarSat2NoiseLevel &rhs)
 Copy constructor. More...
 
RadarSat2NoiseLeveloperator= (const RadarSat2NoiseLevel &rhs)
 Affectation operator. More...
 
bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 Method to save object state to a keyword list. More...
 
bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 Method to the load (recreate) the state of the object from a keyword list. More...
 
virtual std::ostream & print (std::ostream &out) const
 
void set_incidenceAngleCorrectionName (const ossimString &value)
 
void set_pixelFirstNoiseValue (const ossim_uint32 &value)
 
void set_stepSize (const ossim_uint32 &value)
 
void set_numberOfNoiseLevelValues (const ossim_uint32 &value)
 
void set_noiseLevelValues (const std::vector< ossim_float64 > &value)
 
void set_units (const ossimString &value)
 
void set_offset (const ossim_float64 &value)
 
void set_gain (const ossimString &value)
 
const ossimStringget_incidenceAngleCorrectionName () const
 
const ossimStringget_gain () const
 

Protected Attributes

ossimString _incidenceAngleCorrectionName
 Incidence Angle correction Name. More...
 
ossim_uint32 _pixelFirstNoiseValue
 pixel First Noise Value More...
 
ossim_uint32 _stepSize
 step Size More...
 
ossim_uint32 _numberOfNoiseLevelValues
 number Of Noise Level Values More...
 
std::vector< ossim_float64_noiseLevelValues
 noise Level Values More...
 
ossimString _units
 noise Level units More...
 
ossim_float64 _offset
 offset value More...
 
ossimString _gain
 lookup table More...
 

Detailed Description

This class represents an Noise.

Definition at line 29 of file RadarSat2NoiseLevel.h.

Constructor & Destructor Documentation

◆ RadarSat2NoiseLevel() [1/2]

ossimplugins::RadarSat2NoiseLevel::RadarSat2NoiseLevel ( )

Constructor.

Definition at line 37 of file RadarSat2NoiseLevel.cpp.

37  :
40  _stepSize(0),
43  _units("Unknown"),
44  _offset(0.0),
45  _gain()
46 {
47 }
ossimString _incidenceAngleCorrectionName
Incidence Angle correction Name.
std::vector< ossim_float64 > _noiseLevelValues
noise Level Values
ossim_uint32 _pixelFirstNoiseValue
pixel First Noise Value
ossim_uint32 _numberOfNoiseLevelValues
number Of Noise Level Values
ossim_float64 _offset
offset value
ossimString _units
noise Level units

◆ ~RadarSat2NoiseLevel()

ossimplugins::RadarSat2NoiseLevel::~RadarSat2NoiseLevel ( )
virtual

Destructor.

Definition at line 49 of file RadarSat2NoiseLevel.cpp.

50 {
51 }

◆ RadarSat2NoiseLevel() [2/2]

ossimplugins::RadarSat2NoiseLevel::RadarSat2NoiseLevel ( const RadarSat2NoiseLevel rhs)

Copy constructor.

Definition at line 54 of file RadarSat2NoiseLevel.cpp.

54  :
55  _incidenceAngleCorrectionName(rhs._incidenceAngleCorrectionName),
56  _pixelFirstNoiseValue(rhs._pixelFirstNoiseValue),
57  _stepSize(rhs._stepSize),
58  _numberOfNoiseLevelValues(rhs._numberOfNoiseLevelValues),
59  _noiseLevelValues(rhs._noiseLevelValues),
60  _units(rhs._units),
61  _offset(rhs._offset),
62  _gain(rhs._gain)
63 {
64 }
ossimString _incidenceAngleCorrectionName
Incidence Angle correction Name.
std::vector< ossim_float64 > _noiseLevelValues
noise Level Values
ossim_uint32 _pixelFirstNoiseValue
pixel First Noise Value
ossim_uint32 _numberOfNoiseLevelValues
number Of Noise Level Values
ossim_float64 _offset
offset value
ossimString _units
noise Level units

Member Function Documentation

◆ get_gain()

const ossimString& ossimplugins::RadarSat2NoiseLevel::get_gain ( ) const
inline

Definition at line 110 of file RadarSat2NoiseLevel.h.

111  {
112  return _gain;
113  }

◆ get_incidenceAngleCorrectionName()

const ossimString& ossimplugins::RadarSat2NoiseLevel::get_incidenceAngleCorrectionName ( ) const
inline

Definition at line 106 of file RadarSat2NoiseLevel.h.

Referenced by ossimplugins::ossimRadarSat2Model::InitLut().

107  {
109  }
ossimString _incidenceAngleCorrectionName
Incidence Angle correction Name.

◆ loadState()

bool ossimplugins::RadarSat2NoiseLevel::loadState ( const ossimKeywordlist kwl,
const char *  prefix = 0 
)

Method to the load (recreate) the state of the object from a keyword list.

Return true if ok or false on error.

Returns
true if load OK, false on error

Definition at line 133 of file RadarSat2NoiseLevel.cpp.

References _gain, _incidenceAngleCorrectionName, _noiseLevelValues, _numberOfNoiseLevelValues, _offset, _pixelFirstNoiseValue, _stepSize, _units, ossimString::c_str(), ossimKeywordlist::find(), ossimNotify(), ossimNotifyLevel_WARN, ossimString::toDouble(), ossimString::toFloat64(), ossimString::toString(), and ossimString::toUInt32().

134 {
135  static const char MODULE[] = "RadarSat2NoiseLevel::loadState";
136 
137  //bool result = true;
138  ossimString s;
139  const char* lookup = 0;
140 
141  std::string pfx("");
142  if (prefix)
143  {
144  pfx = prefix;
145  }
146 
147  pfx += NOISE;
148 
149  if(_incidenceAngleCorrectionName == "Gamma")
150  {
151  pfx = pfx + "["+ GAMMA +"]";
152  }
153  if(_incidenceAngleCorrectionName == "Sigma Nought")
154  {
155  pfx = pfx + "["+ SIGMA_NOUGHT +"]";
156  }
157  if(_incidenceAngleCorrectionName == "Beta Nought")
158  {
159  pfx = pfx + "["+ BETA_NOUGHT +"]";
160  }
161 
162 
163 
164  std::string s1 = pfx + "["+ GAMMA +"]";
165  lookup = kwl.find(s1.c_str(), INCIDENCE_ANGLE_CORRECTION_NAME_KW);
166  if (!lookup)
167  {
168  std::string s1 = pfx + "["+ SIGMA_NOUGHT +"]";
169  lookup = kwl.find(s1.c_str(), INCIDENCE_ANGLE_CORRECTION_NAME_KW);
170  if (!lookup)
171  {
172  std::string s1 = pfx + "["+ BETA_NOUGHT +"]";
173  lookup = kwl.find(s1.c_str(), INCIDENCE_ANGLE_CORRECTION_NAME_KW);
174  if (!lookup)
175  {
177  << MODULE << " Keyword not found: " << INCIDENCE_ANGLE_CORRECTION_NAME_KW << "\n";
178  return false;
179  }
180  }
181  }
182 
184  pfx= s1;
185 
186  lookup = kwl.find(s1.c_str(), PIXEL_FIRST_NOISE_VALUE_KW);
187  if (lookup)
188  {
189  s = lookup;
191  }
192  else
193  {
195  << MODULE << " Keyword not found: " << PIXEL_FIRST_NOISE_VALUE_KW << "\n";
196  return false;
197  }
198 
199  lookup = kwl.find(s1.c_str(), STEP_SIZE_KW);
200  if (lookup)
201  {
202  s = lookup;
203  _stepSize = s.toUInt32();
204  }
205  else
206  {
208  << MODULE << " Keyword not found: " << STEP_SIZE_KW << "\n";
209  return false;
210  }
211 
212  lookup = kwl.find(s1.c_str(), NUMBER_OF_NOISE_LEVEL_VALUE_KW);
213  if (lookup)
214  {
215  s = lookup;
217  }
218  else
219  {
221  << MODULE << " Keyword not found: " << NUMBER_OF_NOISE_LEVEL_VALUE_KW << "\n";
222  return false;
223  }
224 
225 
226  lookup = kwl.find(s1.c_str(), UNITS_KW);
227  if (lookup)
228  {
229  _units = lookup;
230  }
231  else
232  {
234  << MODULE << " Keyword not found: " << UNITS_KW << "\n";
235  return false;
236  }
237 
238  _noiseLevelValues.clear();
239  for (unsigned int i = 0; i < _numberOfNoiseLevelValues; ++i)
240  {
241  s = pfx + NOISE_LEVEL_VALUES_KW + "[" + ossimString::toString(i) + "]";
242  lookup = kwl.find(s.c_str(), "");
243  if (lookup)
244  {
245  s = lookup;
246  _noiseLevelValues.push_back( s.toDouble() );
247  }
248  }
249 
251  {
253  << MODULE
254  << " Keyword " << NOISE_LEVEL_VALUES_KW
255  << " is different with the number of noise level values"
256  << std::endl;
257  return false;
258  }
259 
260  lookup = kwl.find(s1.c_str(), GAIN_KW);
261  if (lookup)
262  {
263  _gain = lookup;;
264  }
265  else
266  {
268  << MODULE << " Keyword not found: " << GAIN_KW << "\n";
269  return false;
270  }
271 
272  lookup = kwl.find(s1.c_str(), OFFSET_KW);
273  if (lookup)
274  {
275  s = lookup;
276  _offset = s.toFloat64();
277  }
278  else
279  {
281  << MODULE << " Keyword not found: " << OFFSET_KW << "\n";
282  return false;
283  }
284 
286  {
288  << MODULE
289  << " Keyword " << NOISE_LEVEL_VALUES_KW
290  << " is different with the number of noise level values"
291  << std::endl;
292  return false;
293  }
294 
295 
296  return true;
297 }
const char * find(const char *key) const
static ossimString toString(bool aValue)
Numeric to string methods.
ossim_uint32 toUInt32() const
ossimString _incidenceAngleCorrectionName
Incidence Angle correction Name.
std::vector< ossim_float64 > _noiseLevelValues
noise Level Values
double toDouble() const
ossim_float64 toFloat64() const
ossim_uint32 _pixelFirstNoiseValue
pixel First Noise Value
ossim_uint32 _numberOfNoiseLevelValues
number Of Noise Level Values
ossim_float64 _offset
offset value
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
ossimString _units
noise Level units
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ operator=()

RadarSat2NoiseLevel & ossimplugins::RadarSat2NoiseLevel::operator= ( const RadarSat2NoiseLevel rhs)

Affectation operator.

Definition at line 66 of file RadarSat2NoiseLevel.cpp.

References _gain, _incidenceAngleCorrectionName, _noiseLevelValues, _numberOfNoiseLevelValues, _offset, _pixelFirstNoiseValue, _stepSize, and _units.

67 {
68  _incidenceAngleCorrectionName = rhs._incidenceAngleCorrectionName;
69  _pixelFirstNoiseValue = rhs._pixelFirstNoiseValue;
70  _stepSize = rhs._stepSize;
71  _numberOfNoiseLevelValues = rhs._numberOfNoiseLevelValues;
72  _noiseLevelValues = rhs._noiseLevelValues;
73  _units = rhs._units;
74  _offset = rhs._offset;
75  _gain = rhs._gain;
76  return *this;
77 }
ossimString _incidenceAngleCorrectionName
Incidence Angle correction Name.
std::vector< ossim_float64 > _noiseLevelValues
noise Level Values
ossim_uint32 _pixelFirstNoiseValue
pixel First Noise Value
ossim_uint32 _numberOfNoiseLevelValues
number Of Noise Level Values
ossim_float64 _offset
offset value
ossimString _units
noise Level units

◆ print()

std::ostream & ossimplugins::RadarSat2NoiseLevel::print ( std::ostream &  out) const
virtual

METHOD: print() Fulfills base-class pure virtual. Dumps contents of object to ostream.

Definition at line 300 of file RadarSat2NoiseLevel.cpp.

301 {
302  out << setprecision(15) << setiosflags(ios::fixed)
303  << "\n RadarSat2NoiseLevel class data members:\n";
304 
305  //const char* prefix = 0;
306  //ossimKeywordlist kwl;
307  //ossimString pfx;
308 
309  /* TODO Add print method*/
310 
311  //out << kwl;
312 
313  return out;
314 }

◆ saveState()

bool ossimplugins::RadarSat2NoiseLevel::saveState ( ossimKeywordlist kwl,
const char *  prefix = 0 
) const

Method to save object state to a keyword list.

Parameters
kwlKeyword list to save to.
prefixadded to keys when saved.
Returns
true on success, false on error.

Definition at line 79 of file RadarSat2NoiseLevel.cpp.

References _gain, _incidenceAngleCorrectionName, _noiseLevelValues, _numberOfNoiseLevelValues, _offset, _pixelFirstNoiseValue, _stepSize, _units, ossimKeywordlist::add(), ossimString::chars(), and ossimString::toString().

80 {
81  std::string pfx;
82  if (prefix)
83  {
84  pfx = prefix;
85  }
86  pfx += NOISE;
87 
88  if(_incidenceAngleCorrectionName == "Gamma")
89  {
90  pfx = pfx + "["+ GAMMA +"]";
91  }
92  if(_incidenceAngleCorrectionName == "Sigma Nought")
93  {
94  pfx = pfx + "["+ SIGMA_NOUGHT +"]";
95  }
96  if(_incidenceAngleCorrectionName == "Beta Nought")
97  {
98  pfx = pfx + "["+ BETA_NOUGHT +"]";
99  }
100 
101  pfx +=".";
102 
103  std::string s = pfx + INCIDENCE_ANGLE_CORRECTION_NAME_KW;
104  kwl.add(prefix, s.c_str(), _incidenceAngleCorrectionName);
105 
106  s = pfx + PIXEL_FIRST_NOISE_VALUE_KW;
107  kwl.add(prefix, s.c_str(), _pixelFirstNoiseValue);
108 
109  s = pfx + STEP_SIZE_KW;
110  kwl.add(prefix, s.c_str(), _stepSize);
111 
112  s = pfx + NUMBER_OF_NOISE_LEVEL_VALUE_KW;
113  kwl.add(prefix, s.c_str(), _numberOfNoiseLevelValues);
114 
115  s = pfx + UNITS_KW;
116  kwl.add(prefix, s.c_str(), _units);
117 
118  for (unsigned int i = 0; i < _noiseLevelValues.size(); ++i)
119  {
120  s = pfx + NOISE_LEVEL_VALUES_KW + "[" + ossimString::toString(i).chars() + "]";
121  kwl.add(prefix, s.c_str(), _noiseLevelValues[i]);
122  }
123 
124  s = pfx + OFFSET_KW;
125  kwl.add(prefix, s.c_str(), _offset);
126 
127  s = pfx + GAIN_KW;
128  kwl.add(prefix, s.c_str(), _gain);
129 
130  return true;
131 }
static ossimString toString(bool aValue)
Numeric to string methods.
ossimString _incidenceAngleCorrectionName
Incidence Angle correction Name.
std::vector< ossim_float64 > _noiseLevelValues
noise Level Values
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
const char * chars() const
For backward compatibility.
Definition: ossimString.h:77
ossim_uint32 _pixelFirstNoiseValue
pixel First Noise Value
ossim_uint32 _numberOfNoiseLevelValues
number Of Noise Level Values
ossim_float64 _offset
offset value
ossimString _units
noise Level units

◆ set_gain()

void ossimplugins::RadarSat2NoiseLevel::set_gain ( const ossimString value)
inline

Definition at line 101 of file RadarSat2NoiseLevel.h.

Referenced by ossimplugins::ossimRadarSat2Model::InitLut().

102  {
103  _gain = value;
104  }

◆ set_incidenceAngleCorrectionName()

void ossimplugins::RadarSat2NoiseLevel::set_incidenceAngleCorrectionName ( const ossimString value)
inline

Definition at line 73 of file RadarSat2NoiseLevel.h.

Referenced by ossimplugins::ossimRadarSat2Model::InitRefNoiseLevel().

74  {
76  }
ossimString _incidenceAngleCorrectionName
Incidence Angle correction Name.

◆ set_noiseLevelValues()

void ossimplugins::RadarSat2NoiseLevel::set_noiseLevelValues ( const std::vector< ossim_float64 > &  value)
inline

Definition at line 89 of file RadarSat2NoiseLevel.h.

Referenced by ossimplugins::ossimRadarSat2Model::InitRefNoiseLevel().

90  {
91  _noiseLevelValues = value;
92  }
std::vector< ossim_float64 > _noiseLevelValues
noise Level Values

◆ set_numberOfNoiseLevelValues()

void ossimplugins::RadarSat2NoiseLevel::set_numberOfNoiseLevelValues ( const ossim_uint32 value)
inline

Definition at line 85 of file RadarSat2NoiseLevel.h.

Referenced by ossimplugins::ossimRadarSat2Model::InitRefNoiseLevel().

86  {
88  }
ossim_uint32 _numberOfNoiseLevelValues
number Of Noise Level Values

◆ set_offset()

void ossimplugins::RadarSat2NoiseLevel::set_offset ( const ossim_float64 value)
inline

Definition at line 97 of file RadarSat2NoiseLevel.h.

Referenced by ossimplugins::ossimRadarSat2Model::InitLut().

98  {
99  _offset = value;
100  }
ossim_float64 _offset
offset value

◆ set_pixelFirstNoiseValue()

void ossimplugins::RadarSat2NoiseLevel::set_pixelFirstNoiseValue ( const ossim_uint32 value)
inline

Definition at line 77 of file RadarSat2NoiseLevel.h.

Referenced by ossimplugins::ossimRadarSat2Model::InitRefNoiseLevel().

78  {
79  _pixelFirstNoiseValue = value;
80  }
ossim_uint32 _pixelFirstNoiseValue
pixel First Noise Value

◆ set_stepSize()

void ossimplugins::RadarSat2NoiseLevel::set_stepSize ( const ossim_uint32 value)
inline

Definition at line 81 of file RadarSat2NoiseLevel.h.

Referenced by ossimplugins::ossimRadarSat2Model::InitRefNoiseLevel().

82  {
83  _stepSize = value;
84  }

◆ set_units()

void ossimplugins::RadarSat2NoiseLevel::set_units ( const ossimString value)
inline

Definition at line 93 of file RadarSat2NoiseLevel.h.

Referenced by ossimplugins::ossimRadarSat2Model::InitRefNoiseLevel().

94  {
95  _units = value;
96  }
ossimString _units
noise Level units

Member Data Documentation

◆ _gain

ossimString ossimplugins::RadarSat2NoiseLevel::_gain
protected

lookup table

Definition at line 154 of file RadarSat2NoiseLevel.h.

Referenced by loadState(), operator=(), and saveState().

◆ _incidenceAngleCorrectionName

ossimString ossimplugins::RadarSat2NoiseLevel::_incidenceAngleCorrectionName
protected

Incidence Angle correction Name.

Definition at line 120 of file RadarSat2NoiseLevel.h.

Referenced by loadState(), operator=(), and saveState().

◆ _noiseLevelValues

std::vector<ossim_float64> ossimplugins::RadarSat2NoiseLevel::_noiseLevelValues
protected

noise Level Values

Definition at line 139 of file RadarSat2NoiseLevel.h.

Referenced by loadState(), operator=(), and saveState().

◆ _numberOfNoiseLevelValues

ossim_uint32 ossimplugins::RadarSat2NoiseLevel::_numberOfNoiseLevelValues
protected

number Of Noise Level Values

Definition at line 134 of file RadarSat2NoiseLevel.h.

Referenced by loadState(), operator=(), and saveState().

◆ _offset

ossim_float64 ossimplugins::RadarSat2NoiseLevel::_offset
protected

offset value

Definition at line 149 of file RadarSat2NoiseLevel.h.

Referenced by loadState(), operator=(), and saveState().

◆ _pixelFirstNoiseValue

ossim_uint32 ossimplugins::RadarSat2NoiseLevel::_pixelFirstNoiseValue
protected

pixel First Noise Value

Definition at line 125 of file RadarSat2NoiseLevel.h.

Referenced by loadState(), operator=(), and saveState().

◆ _stepSize

ossim_uint32 ossimplugins::RadarSat2NoiseLevel::_stepSize
protected

step Size

Definition at line 129 of file RadarSat2NoiseLevel.h.

Referenced by loadState(), operator=(), and saveState().

◆ _units

ossimString ossimplugins::RadarSat2NoiseLevel::_units
protected

noise Level units

Definition at line 144 of file RadarSat2NoiseLevel.h.

Referenced by loadState(), operator=(), and saveState().


The documentation for this class was generated from the following files: