USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::ControlPoint Class Reference

#include <ControlPoint.h>

Collaboration diagram for Isis::ControlPoint:

Collaboration graph
[legend]
List of all members.

Detailed Description

A single control point.

A control point is one or more measurements that identify the same feature or location in different images.

Author:
2005-07-29 Jeff Anderson
See also:
ControlMeasure ControlNet

For internal use only.

History:
2005-07-29 Jeff Anderson Original version
History:
2006-01-11 Jacob Danton Added ReferenceIndex method and updated unitTest
History:
2006-06-28 Tracie Sucharski, Added method to return measure for given serial number.
History:
2006-10-31 Tracie Sucharski, Added HasReference method, changed ReferenceIndex method to throw error if there is no Reference ControlMeasure.
History:
2007-01-25 Debbie A. Cook, Removed return statement in SetApriori method for GroundPoint case so that FocalPlaneMeasures will get set. The method already has a later return statement to avoid changing the lat/lon values.
History:
2007-10-19 Debbie A. Cook, Wrapped longitudes when calculating apriori longitude for points with a difference of more than 180 degrees of longitude between measures.
History:
2008-01-14 Debbie A. Cook, Changed call to Camera->SetUniversalGround in ComputeErrors to include the radius as an argument since the method has been overloaded to include radius.
History:
2008-09-12 Tracie Sucharski, Add method to return true/false for existence of Serial Number.
History:
2009-03-07 Debbie A. Cook Fixed ComputeErrors method to set focal plane coordinates without changing time and improved error messages.
History:
2009-06-03 Christopher Austin, Added the p_invalid functionality along with forceBuild, fixed documentation errors.
History:
2009-06-22 Jeff Anderson, Modified ComputeAprior method to correctly handle ground and held points. Previosuly it would throw an error if the lat/lon of a measure could not be computed. Also, modify the ComputeErrors method to not abort any longer if a control point lat/lon could not be projected back to a image line/sample.
History:
2009-08-13 Debbie A. Cook Corrected calculation of scale used to get the undistorted focal plane coordinates to use the signed focal length (Z) from the CameraDistortionMap,
History:
2009-08-21 Christopher Austin, Put the default return of ReferenceIndex() back as the first Measured measure.

Definition at line 84 of file ControlPoint.h.

Public Types

 Ground
 A Ground point is a Control Point whose lat/lon is well established and should not be changed.
 Tie
 A Tie point is a Control Point that identifies common measurements between two or more cubes.
enum  PointType { Ground, Tie }
 A control point can have one of two types, either Ground or Tie. More...

Public Member Functions

 ControlPoint ()
 Construct a control point.
 ControlPoint (const std::string &id)
 Construct a control point with given Id.
 ~ControlPoint ()
 Destroy a control point.
void Load (PvlObject &p, bool forceBuild=false)
 Loads the PvlObject into a ControlPoint.
PvlObject CreatePvlObject ()
 Creates a PvlObject from the ControlPoint.
void SetId (const std::string &id)
 Sets the Id of the control point.
std::string Id () const
 Return the Id of the control point.
void Add (const ControlMeasure &measure, bool forceBuild=false)
 Add a measurement to the control point.
void Delete (int index)
 Remove a measurement from the control point.
ControlMeasureoperator[] (int index)
 Return the ith measurement of the control point.
const ControlMeasureoperator[] (int index) const
 Return the ith measurement of the control point.
ControlMeasureoperator[] (const std::string &serialNumber)
 Return the measurement for the given serial number.
const ControlMeasureoperator[] (const std::string &serialNumber) const
 Return the measurement for the given serial number.
bool HasSerialNumber (std::string &serialNumber)
 Return true if given serial number exists in point.
int Size () const
 Return the number of measurements in the control point.
int NumValidMeasures ()
 Returns the number of non-ignored control measures.
void SetIgnore (bool ignore)
 Set whether to ignore or use control point.
bool Ignore () const
 Return if the control point should be ignored.
bool Invalid () const
 Return if the control point is invalid.
void SetHeld (bool held)
 Set the control point as held to its lat/lon.
bool Held () const
 Is the control point lat/lon held?
void SetType (PointType type)
 Change the type of the control point.
PointType Type () const
 Return the type of the point.
const std::string PointTypeToString (PointType type) const
 Obtain a string representation of a given PointType.
void SetUniversalGround (double lat, double lon, double radius)
 Set the ground coordinate of a control point.
double UniversalLatitude () const
 Return the planetocentric latitude of the point.
double UniversalLongitude () const
 Return the planetocentric longitude of the point.
double Radius () const
 Return the radius of the point in meters.
double AverageError () const
 Return the average error of all measurements.
bool HasReference ()
 Return true if there is a Reference measure, otherwise return false.
int ReferenceIndex ()
 Return the index of the reference measurement if none is specified, return the first measured CM.
void ComputeApriori ()
 This method computes the apriori lat/lon for a point.
void ComputeErrors ()
 This method computes the errors for a point.
double MaximumError () const
 Return the maximum error magnitude of the measures in the point.
double WrapLongitude (double lon, double baselon)
 Wraps the input longitude toward a base longitude.

Private Attributes

std::string p_id
 Point Id.
std::vector< Isis::ControlMeasurep_measures
 List of Control Measures.
PointType p_type
 This Control Point's Type.
bool p_ignore
 If this Control Point is ignored.
bool p_held
 If this Control Point is held.
double p_latitude
 The Latitude of this Control Point.
double p_longitude
 The Longtude of this Control Point.
double p_radius
 The raduis of this Control Point.
bool p_invalid
 If this Control Point is invalid.


Member Enumeration Documentation

enum Isis::ControlPoint::PointType

A control point can have one of two types, either Ground or Tie.

Enumerator:
Ground  A Ground point is a Control Point whose lat/lon is well established and should not be changed.

Some people will refer to this as a truth (i.e., ground truth). Holding a point is equivalent to making it a ground point. A ground point can be identifed in one or more cubes.

Tie  A Tie point is a Control Point that identifies common measurements between two or more cubes.

While it could have a lat/lon, it is not necessarily correct and is subject to change. This is the most common type of control point.

Definition at line 170 of file ControlPoint.h.


Constructor & Destructor Documentation

Isis::ControlPoint::ControlPoint (  ) 

Construct a control point.

Definition at line 12 of file ControlPoint.cpp.

References Isis::Null, SetHeld(), SetId(), SetIgnore(), SetType(), SetUniversalGround(), and Tie.

Isis::ControlPoint::ControlPoint ( const std::string &  id  ) 

Construct a control point with given Id.

Parameters:
id Control Point Id

Definition at line 25 of file ControlPoint.cpp.

References Isis::Null, SetHeld(), SetId(), SetIgnore(), SetType(), SetUniversalGround(), and Tie.

Isis::ControlPoint::~ControlPoint (  )  [inline]

Destroy a control point.

Definition at line 90 of file ControlPoint.h.


Member Function Documentation

void Isis::ControlPoint::Add ( const ControlMeasure measure,
bool  forceBuild = false 
)

Add a measurement to the control point.

Parameters:
measure The ControlMeasure to add
forceBuild Forces the Control Measure to be added reguardless of validity

Definition at line 129 of file ControlPoint.cpp.

References _FILEINFO_, Isis::ControlMeasure::CubeSerialNumber(), Isis::iException::Message(), p_invalid, p_measures, and Size().

Referenced by Load().

double Isis::ControlPoint::AverageError (  )  const

Return the average error of all measurements.

Definition at line 266 of file ControlPoint.cpp.

References Ignore(), p_measures, and Type().

void Isis::ControlPoint::ComputeApriori (  ) 

This method computes the apriori lat/lon for a point.

It computes this by determining the average lat/lon of all the measures. Note that this does not change held, ignored, or ground points. Also, it does not use unmeasured or ignored measures when computing the lat/lon.

History:
2008-06-18 Tracie Sucharski/Jeannie Walldren, Changed error messages for Held/Ground points.

Definition at line 337 of file ControlPoint.cpp.

References _FILEINFO_, cam, Isis::Camera::Camera(), Isis::Camera::DistortionMap(), Isis::Spice::EphemerisTime(), Ground, Held(), Id(), Ignore(), Isis::Sensor::LocalRadius(), Isis::iException::Message(), Isis::Null, p_latitude, p_longitude, p_measures, p_radius, Isis::Camera::SetImage(), SetUniversalGround(), Type(), Isis::CameraDistortionMap::UndistortedFocalPlaneX(), Isis::CameraDistortionMap::UndistortedFocalPlaneY(), Isis::Sensor::UniversalLatitude(), Isis::Sensor::UniversalLongitude(), WrapLongitude(), x, and y.

void Isis::ControlPoint::ComputeErrors (  ) 

This method computes the errors for a point.

History:
2008-07-17 Tracie Sucharski, Added ptid and measure serial number to the unable to map to surface error.

Definition at line 446 of file ControlPoint.cpp.

References _FILEINFO_, cam, Isis::Camera::Camera(), Isis::CameraFocalPlaneMap::DetectorLine(), Isis::CameraFocalPlaneMap::DetectorSample(), Id(), Ignore(), Isis::CameraDetectorMap::LineScaleFactor(), Isis::iException::Message(), p_measures, Isis::PI(), Radius(), Isis::CameraDetectorMap::SampleScaleFactor(), Isis::CameraFocalPlaneMap::SetFocalPlane(), Isis::Camera::SetImage(), UniversalLatitude(), and UniversalLongitude().

PvlObject Isis::ControlPoint::CreatePvlObject (  ) 

Creates a PvlObject from the ControlPoint.

Returns:
The PvlObject created
Exceptions:
Isis::iException::Programmer - Invalid Point Enumeration

Definition at line 89 of file ControlPoint.cpp.

References _FILEINFO_, Isis::PvlObject::AddGroup(), g, Ground, Isis::iException::Message(), Isis::Null, p_held, p_id, p_ignore, p_latitude, p_longitude, p_radius, p_type, Size(), and Tie.

void Isis::ControlPoint::Delete ( int  index  ) 

Remove a measurement from the control point.

Parameters:
index The index of the control point to delete

Definition at line 151 of file ControlPoint.cpp.

References Isis::ControlMeasure::CubeSerialNumber(), operator[](), p_invalid, p_measures, and Size().

bool Isis::ControlPoint::HasReference (  ) 

Return true if there is a Reference measure, otherwise return false.

Todo:
??? Check for more than one reference measure ??? Should print error, this check should also go in ReferenceIndex.

Definition at line 288 of file ControlPoint.cpp.

References _FILEINFO_, Id(), Isis::iException::Message(), and p_measures.

bool Isis::ControlPoint::HasSerialNumber ( std::string &  serialNumber  ) 

Return true if given serial number exists in point.

Parameters:
serialNumber The serial number
Returns:
True if point contains serial number, false if not

Definition at line 212 of file ControlPoint.cpp.

References Size().

bool Isis::ControlPoint::Held (  )  const [inline]

Is the control point lat/lon held?

Definition at line 165 of file ControlPoint.h.

References p_held.

Referenced by Isis::BundleAdjust::AddPartials(), and ComputeApriori().

std::string Isis::ControlPoint::Id (  )  const [inline]

Return the Id of the control point.

Returns:
Control Point Id

Definition at line 108 of file ControlPoint.h.

References p_id.

Referenced by Isis::ControlNet::Add(), ComputeApriori(), ComputeErrors(), Isis::ControlNet::Exists(), HasReference(), Load(), and ReferenceIndex().

bool Isis::ControlPoint::Ignore (  )  const [inline]

Return if the control point should be ignored.

Definition at line 152 of file ControlPoint.h.

References p_ignore.

Referenced by Isis::BundleAdjust::AddPartials(), AverageError(), ComputeApriori(), ComputeErrors(), MaximumError(), and NumValidMeasures().

bool Isis::ControlPoint::Invalid (  )  const [inline]

Return if the control point is invalid.

Definition at line 155 of file ControlPoint.h.

References p_invalid.

void Isis::ControlPoint::Load ( PvlObject p,
bool  forceBuild = false 
)

Loads the PvlObject into a ControlPoint.

Parameters:
p PvlObject containing ControlPoint information
forceBuild Forces invalid Control Measures to be added to this Control Point
Exceptions:
Isis::iException::User - Invalid Point Type
Isis::iException::User - Unable to add ControlMeasure to ControlPoint
History:
2008-06-18 Tracie Sucharski/Jeannie Walldren, Fixed bug with checking for "True" vs "true", change to lower case for comparison.

Definition at line 47 of file ControlPoint.cpp.

References _FILEINFO_, Add(), e, g, Ground, Isis::PvlObject::Group(), Isis::PvlObject::Groups(), Isis::PvlObject::HasKeyword(), Id(), Isis::PvlContainer::IsNamed(), Isis::iException::Message(), SetHeld(), SetId(), SetIgnore(), SetType(), SetUniversalGround(), and Tie.

double Isis::ControlPoint::MaximumError (  )  const

Return the maximum error magnitude of the measures in the point.

Ignored and unmeasured measures will not be included.

Definition at line 527 of file ControlPoint.cpp.

References Ignore(), p_measures, and Type().

int Isis::ControlPoint::NumValidMeasures (  ) 

Returns the number of non-ignored control measures.

Returns:
Number of valid control measures

Definition at line 570 of file ControlPoint.cpp.

References Ignore(), p_measures, Size(), and size.

const ControlMeasure & Isis::ControlPoint::operator[] ( const std::string &  serialNumber  )  const

Return the measurement for the given serial number.

Parameters:
serialNumber The serial number
Returns:
The ControlMeasure corresponding to the give serial number

Definition at line 194 of file ControlPoint.cpp.

References _FILEINFO_, Isis::iException::Message(), and Size().

ControlMeasure & Isis::ControlPoint::operator[] ( const std::string &  serialNumber  ) 

Return the measurement for the given serial number.

Parameters:
serialNumber The serial number
Returns:
The ControlMeasure corresponding to the give serial number

Definition at line 175 of file ControlPoint.cpp.

References _FILEINFO_, Isis::iException::Message(), and Size().

const ControlMeasure& Isis::ControlPoint::operator[] ( int  index  )  const [inline]

Return the ith measurement of the control point.

Parameters:
index Control Measure index
Returns:
The Control Measure at the provided index

Definition at line 129 of file ControlPoint.h.

References p_measures.

ControlMeasure& Isis::ControlPoint::operator[] ( int  index  )  [inline]

Return the ith measurement of the control point.

Parameters:
index Control Measure index
Returns:
The Control Measure at the provided index

Definition at line 120 of file ControlPoint.h.

References p_measures.

Referenced by Delete().

const std::string Isis::ControlPoint::PointTypeToString ( ControlPoint::PointType  type  )  const

Obtain a string representation of a given PointType.

Parameters:
type PointType to get a string representation of
Returns:
A string representation of type
Exceptions:
iException::Programmer When unable to translate type

Definition at line 232 of file ControlPoint.cpp.

References _FILEINFO_, Ground, Isis::iException::Message(), str, and Tie.

double Isis::ControlPoint::Radius (  )  const [inline]

Return the radius of the point in meters.

Definition at line 209 of file ControlPoint.h.

References p_radius.

Referenced by Isis::BundleAdjust::AddPartials(), ComputeErrors(), and Isis::BundleAdjust::PointPartial().

int Isis::ControlPoint::ReferenceIndex (  ) 

Return the index of the reference measurement if none is specified, return the first measured CM.

Returns:
The PvlObject created

Definition at line 308 of file ControlPoint.cpp.

References _FILEINFO_, Id(), Isis::iException::Message(), and p_measures.

void Isis::ControlPoint::SetHeld ( bool  held  )  [inline]

Set the control point as held to its lat/lon.

Parameters:
held True to hold this Control Point, False to release

Definition at line 162 of file ControlPoint.h.

References p_held.

Referenced by ControlPoint(), and Load().

void Isis::ControlPoint::SetId ( const std::string &  id  )  [inline]

Sets the Id of the control point.

Parameters:
id Control Point Id

Definition at line 101 of file ControlPoint.h.

References p_id.

Referenced by ControlPoint(), and Load().

void Isis::ControlPoint::SetIgnore ( bool  ignore  )  [inline]

Set whether to ignore or use control point.

Parameters:
ignore True to ignore this Control Point, False to un-ignore

Definition at line 149 of file ControlPoint.h.

References p_ignore.

Referenced by ControlPoint(), and Load().

void Isis::ControlPoint::SetType ( PointType  type  )  [inline]

Change the type of the control point.

Parameters:
type The type for this Control Point

Definition at line 193 of file ControlPoint.h.

References p_type.

Referenced by ControlPoint(), and Load().

void Isis::ControlPoint::SetUniversalGround ( double  lat,
double  lon,
double  radius 
)

Set the ground coordinate of a control point.

Parameters:
lat planetocentric latitude in degrees
lon planetocentric longitude in degrees
radius radius at coordinate in meters

Definition at line 259 of file ControlPoint.cpp.

References p_latitude, p_longitude, and p_radius.

Referenced by ComputeApriori(), ControlPoint(), and Load().

int Isis::ControlPoint::Size (  )  const [inline]

Return the number of measurements in the control point.

Definition at line 141 of file ControlPoint.h.

References p_measures.

Referenced by Add(), Isis::BundleAdjust::AddPartials(), CreatePvlObject(), Delete(), Qisis::MosaicPointTool::findPoint(), HasSerialNumber(), NumValidMeasures(), and operator[]().

PointType Isis::ControlPoint::Type (  )  const [inline]

Return the type of the point.

Definition at line 196 of file ControlPoint.h.

References p_type.

Referenced by Isis::BundleAdjust::AddPartials(), AverageError(), ComputeApriori(), Qisis::MosaicPointTool::findPoint(), and MaximumError().

double Isis::ControlPoint::UniversalLatitude (  )  const [inline]

Return the planetocentric latitude of the point.

Definition at line 203 of file ControlPoint.h.

References p_latitude.

Referenced by Isis::BundleAdjust::AddPartials(), ComputeErrors(), and Isis::BundleAdjust::PointPartial().

double Isis::ControlPoint::UniversalLongitude (  )  const [inline]

Return the planetocentric longitude of the point.

Definition at line 206 of file ControlPoint.h.

References p_longitude.

Referenced by Isis::BundleAdjust::AddPartials(), ComputeErrors(), and Isis::BundleAdjust::PointPartial().

double Isis::ControlPoint::WrapLongitude ( double  lon,
double  baselon 
)

Wraps the input longitude toward a base longitude.

Parameters:
lon Input longitude to be wrapped
baselon Longitude to compare
Returns:
The wrapped longitude

Definition at line 550 of file ControlPoint.cpp.

Referenced by ComputeApriori().


Member Data Documentation

bool Isis::ControlPoint::p_held [private]

If this Control Point is held.

Definition at line 232 of file ControlPoint.h.

Referenced by CreatePvlObject(), Held(), and SetHeld().

std::string Isis::ControlPoint::p_id [private]

Point Id.

Definition at line 228 of file ControlPoint.h.

Referenced by CreatePvlObject(), Id(), and SetId().

bool Isis::ControlPoint::p_ignore [private]

If this Control Point is ignored.

Definition at line 231 of file ControlPoint.h.

Referenced by CreatePvlObject(), Ignore(), and SetIgnore().

bool Isis::ControlPoint::p_invalid [private]

If this Control Point is invalid.

Definition at line 237 of file ControlPoint.h.

Referenced by Add(), Delete(), and Invalid().

double Isis::ControlPoint::p_latitude [private]

The Latitude of this Control Point.

Definition at line 233 of file ControlPoint.h.

Referenced by ComputeApriori(), CreatePvlObject(), SetUniversalGround(), and UniversalLatitude().

double Isis::ControlPoint::p_longitude [private]

The Longtude of this Control Point.

Definition at line 234 of file ControlPoint.h.

Referenced by ComputeApriori(), CreatePvlObject(), SetUniversalGround(), and UniversalLongitude().

std::vector<Isis::ControlMeasure> Isis::ControlPoint::p_measures [private]

List of Control Measures.

Definition at line 229 of file ControlPoint.h.

Referenced by Add(), AverageError(), ComputeApriori(), ComputeErrors(), Delete(), HasReference(), MaximumError(), NumValidMeasures(), operator[](), ReferenceIndex(), and Size().

double Isis::ControlPoint::p_radius [private]

The raduis of this Control Point.

Definition at line 235 of file ControlPoint.h.

Referenced by ComputeApriori(), CreatePvlObject(), Radius(), and SetUniversalGround().

PointType Isis::ControlPoint::p_type [private]

This Control Point's Type.

Definition at line 230 of file ControlPoint.h.

Referenced by CreatePvlObject(), SetType(), and Type().


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