USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::SurfacePoint Class Reference

This class defines a body-fixed surface point. More...

#include <SurfacePoint.h>

Collaboration diagram for Isis::SurfacePoint:
Collaboration graph

Public Member Functions

 SurfacePoint ()
 Constructs an empty SurfacePoint object.
 
 SurfacePoint (const SurfacePoint &other)
 Constructs an empty SurfacePoint object.
 
 SurfacePoint (const Latitude &lat, const Longitude &lon, const Distance &radius)
 Constructs a SurfacePoint object with a spherical point only.
 
 SurfacePoint (const Latitude &lat, const Longitude &lon, const Distance &radius, const Angle &latSigma, const Angle &lonSigma, const Distance &radiusSigma)
 Constructs a SurfacePoint object with a spherical point and its sigmas.
 
 SurfacePoint (const Latitude &lat, const Longitude &lon, const Distance &radius, const boost::numeric::ublas::symmetric_matrix< double, boost::numeric::ublas::upper > &covar)
 
 SurfacePoint (const Displacement &x, const Displacement &y, const Displacement &z)
 Constructs a SurfacePoint object with a rectangular point only.
 
 SurfacePoint (const Displacement &x, const Displacement &y, const Displacement &z, const Distance &xSigma, const Distance &ySigma, const Distance &zSigma)
 Constructs a SurfacePoint object with a rectangular point and sigmas.
 
 SurfacePoint (const Displacement &x, const Displacement &y, const Displacement &z, const boost::numeric::ublas::symmetric_matrix< double, boost::numeric::ublas::upper > &covar)
 
 ~SurfacePoint ()
 Destroys a SurfacePoint object/.
 
void SetRectangular (const Displacement &x, const Displacement &y, const Displacement &z, const Distance &xSigma=Distance(), const Distance &ySigma=Distance(), const Distance &zSigma=Distance())
 Set surface point in rectangular body-fixed coordinates wtih optional sigmas.
 
void SetRectangular (const Displacement x, const Displacement y, const Displacement z, const boost::numeric::ublas::symmetric_matrix< double, boost::numeric::ublas::upper > &covar)
 
void SetRectangularSigmas (const Distance &xSigma, const Distance &ySigma, const Distance &zSigma)
 Set surface point and sigmas in rectangular coordinates and convert to planetocentric.
 
void SetRectangularMatrix (const boost::numeric::ublas::symmetric_matrix< double, boost::numeric::ublas::upper > &covar)
 Set rectangular covariance matrix.
 
void SetSpherical (const Latitude &lat, const Longitude &lon, const Distance &radius, const Angle &latSigma=Angle(), const Angle &lonSigma=Angle(), const Distance &radiusSigma=Distance())
 Set surface point and covariance matrix in planetocentric coordinates and convert to rectangular (Latitude, Longitude in degrees, Radius in meters; matrix in radians and radians**2)
 
void SetSpherical (const Latitude &lat, const Longitude &lon, const Distance &radius, const boost::numeric::ublas::symmetric_matrix< double, boost::numeric::ublas::upper > &covar)
 
void SetSphericalCoordinates (const Latitude &lat, const Longitude &lon, const Distance &radius)
 Update spherical coordinates (lat/lon/radius)
 
void SetSphericalMatrix (const boost::numeric::ublas::symmetric_matrix< double, boost::numeric::ublas::upper > &covar)
 Set spherical covariance matrix.
 
void SetSphericalSigmas (const Angle &latSigma, const Angle &lonSigma, const Distance &radiusSigma)
 Set the spherical sigmas into the spherical variance/covariance matrix.
 
void SetSphericalSigmasDistance (const Distance &latSigma, const Distance &lonSigma, const Distance &radiusSigma)
 Set the spherical sigmas (in meters) into the spherical variance/covariance matrix.
 
void SetRadii (const Distance &majorRadius, const Distance &minorRadius, const Distance &polarRadius)
 Reset the radii of the surface body of the surface point.
 
void ResetLocalRadius (const Distance &radius)
 This method resets the local radius of a SurfacePoint.
 
bool Valid () const
 
Displacement GetX () const
 
Displacement GetY () const
 
Displacement GetZ () const
 
Distance GetXSigma () const
 
Distance GetYSigma () const
 
Distance GetZSigma () const
 
boost::numeric::ublas::symmetric_matrix
< double,
boost::numeric::ublas::upper > 
GetRectangularMatrix () const
 
Latitude GetLatitude () const
 Return the body-fixed latitude for the surface point.
 
Longitude GetLongitude () const
 Return the body-fixed longitude for the surface point.
 
Distance GetLocalRadius () const
 Return the radius of the surface point.
 
Angle GetLatSigma () const
 
Distance GetLatSigmaDistance () const
 Return the latitude sigma in meters.
 
double GetLatWeight () const
 Return latitude weight for bundle adjustment Units are 1/(radians)^2.
 
Angle GetLonSigma () const
 
Distance GetLonSigmaDistance () const
 Return the longiitude sigma in meters.
 
double GetLonWeight () const
 Return longitude weight for bundle adjustment Units are 1/(radians)^2.
 
Distance GetLocalRadiusSigma () const
 
double GetLocalRadiusWeight () const
 Return radius weight for bundle adjustment Units are 1/(meters)^2.
 
boost::numeric::ublas::symmetric_matrix
< double,
boost::numeric::ublas::upper > 
GetSphericalMatrix () const
 
Distance GetDistanceToPoint (const SurfacePoint &other) const
 Computes and returns the distance between two surface points.
 
Distance GetDistanceToPoint (const SurfacePoint &other, const Distance &sphereRadius) const
 Computes and returns the distance between two surface points, assuming both points are on a sphere with the given radius.
 
void ToNaifArray (double naifOutput[3]) const
 A naif array is a c-style array of size 3.
 
void FromNaifArray (const double naifValues[3])
 A naif array is a c-style array of size 3.
 
bool operator== (const SurfacePoint &other) const
 
SurfacePointoperator= (const SurfacePoint &other)
 

Private Member Functions

void InitCovariance ()
 Initialize the variance/covariance matrices.
 
void InitPoint ()
 Initialize a surface point.
 
void InitRadii ()
 Initialize the target surface radii.
 
void SetRectangularPoint (const Displacement &x, const Displacement &y, const Displacement &z)
 This is a private method to set a surface point in rectangular, body-fixed coordinates.
 
void SetSphericalPoint (const Latitude &lat, const Longitude &lon, const Distance &radius)
 This is a private method to set a surface point in spherical (lat/lon/radius), body-fixed coordinates.
 
void FreeAllocatedMemory ()
 

Private Attributes

Distancep_majorAxis
 
Distancep_minorAxis
 
Distancep_polarAxis
 
Displacementp_x
 
Displacementp_y
 
Displacementp_z
 
boost::numeric::ublas::symmetric_matrix
< double,
boost::numeric::ublas::upper > * 
p_rectCovar
 3x3 upper triangular covariance matrix rectangular coordinates
 
boost::numeric::ublas::symmetric_matrix
< double,
boost::numeric::ublas::upper > * 
p_sphereCovar
 3x3 upper triangular covariance matrix ocentric coordinates
 

Detailed Description

This class defines a body-fixed surface point.

This class is a container for body-fixed surface points. It provides methods to set and present the coordinates of surface points in various usable units to support projection of image points to the ground and bundle adjustment.

Author
2010-07-30 Tracie Sucharski, Ken L. Edmunson, and Debbie A. Cook
History:

2010-08-25 Debbie A. Cook Added more error checking and testing

2010-09-10 Debbie A. Cook Made ocentric methods specific to units of sigmas (degrees or meters)

2010-10-04 Debbie A. Cook Remove using boost to avoid compile errors throughout Isis3 classes and added boost namespace name to all uses of matrix

2010-10-20 Debbie A. Cook and Steven Lambright Simplified the class by using new Displacement, Distance, Latitude, Longitude, and Angle objects.

2010-12-28 Steven Lambright and Sharmila Prasad Fixed a problem with retreiving longitudes outside of 0-360.

2011-02-11 Steven Lambright Added SphericalDistanceToPoint and optimized for speed inside the cameras and typical use cases where we only have an x,y,z but no other data. Fixed a problem where points were not properly considered valid at some boundary conditions.

2011-03-05 Ken Edmundson Added GetLatWeight, GetLonWeight, GetLocalRadiusWeight, and SetSphericalCoordinates methods for use in BundleAdjust.

2011-04-18 Steven Lambright GetLatSigmaDistance and GetLonSigmaDistance now return appropriate results when the point is invalid but has radii.

2011-08-08 Steven Lambright and Jai Rideout - SetSphericalSigmas() called with invalid parameters will clear the sigmas. Improved some safety checks.

2011-10-06 Steven Lambright - Get*SigmaDistance will no longer throw an exception if there is no stored sigma and there is no stored target radii.

Definition at line 86 of file SurfacePoint.h.

Constructor & Destructor Documentation

Isis::SurfacePoint::SurfacePoint ( )

Constructs an empty SurfacePoint object.

Definition at line 19 of file SurfacePoint.cpp.

Isis::SurfacePoint::SurfacePoint ( const SurfacePoint other)

Constructs an empty SurfacePoint object.

Definition at line 29 of file SurfacePoint.cpp.

References p_rectCovar, and p_sphereCovar.

Isis::SurfacePoint::SurfacePoint ( const Latitude lat,
const Longitude lon,
const Distance radius 
)

Constructs a SurfacePoint object with a spherical point only.

Parameters
latThe latitude of the surface point
lonThe longitude of the surface point
radiusThe radius of the surface point

Definition at line 95 of file SurfacePoint.cpp.

Isis::SurfacePoint::SurfacePoint ( const Latitude lat,
const Longitude lon,
const Distance radius,
const Angle latSigma,
const Angle lonSigma,
const Distance radiusSigma 
)

Constructs a SurfacePoint object with a spherical point and its sigmas.

Parameters
latThe latitude of the surface point
lonThe longitude of the surface point
radiusThe radius of the surface point
          The sigmas indicate the accuracy of the point.  For instance,
          a latitude sigma of 5 degrees would indicate that the
          latitiude value could have an error or + or - 5 degrees.
sigmaLatThe sigma of the latitude
sigmaLonThe sigma of the longitude
sigmaRadiusThe sigma of the local radius

Definition at line 119 of file SurfacePoint.cpp.

Isis::SurfacePoint::SurfacePoint ( const Displacement x,
const Displacement y,
const Displacement z 
)

Constructs a SurfacePoint object with a rectangular point only.

Parameters
xThe x coordinate of the surface point
yThe y coordinate of the surface point
zThe z coordinate of the surface point

Definition at line 150 of file SurfacePoint.cpp.

Isis::SurfacePoint::SurfacePoint ( const Displacement x,
const Displacement y,
const Displacement z,
const Distance xSigma,
const Distance ySigma,
const Distance zSigma 
)

Constructs a SurfacePoint object with a rectangular point and sigmas.

Parameters
xThe x coordinate of the surface point
yThe y coordinate of the surface point
zThe z coordinate of the surface point
      The sigmas indicate the accuracy of the point.  For instance,
      a sigmaX=100 m, would indicate that the x coordinate was accurate
      to within 100 meters.
xSigmaThe x coordinate of the surface point
ySigmaThe y coordinate of the surface point
zSigmaThe z coordinate of the surface point

Definition at line 173 of file SurfacePoint.cpp.

Isis::SurfacePoint::~SurfacePoint ( )

Destroys a SurfacePoint object/.

Definition at line 205 of file SurfacePoint.cpp.

Member Function Documentation

void Isis::SurfacePoint::FromNaifArray ( const double  naifValues[3])

A naif array is a c-style array of size 3.

The element types are double... keep in mind a SpiceDouble is a double. The values' units are kilometers because that is the unit naif works in. The first element is X, the second Y, and the third Z. This loads the naif array into the surface point.

Parameters
naifValuesThe naif array to use as rectangular coordinates

Definition at line 689 of file SurfacePoint.cpp.

Referenced by Isis::TriangularPlate::intercept(), Isis::EquatorialCylindricalShape::intersectSurface(), Isis::DemShape::intersectSurface(), Isis::PlaneShape::intersectSurface(), and Isis::TriangularPlate::point().

Distance Isis::SurfacePoint::GetDistanceToPoint ( const SurfacePoint other) const

Computes and returns the distance between two surface points.

This does not currently support ellipsoids and so any attempt with points with planetary radii will fail. The average of the local radii will be used.

Definition at line 1046 of file SurfacePoint.cpp.

References _FILEINFO_, and GetLocalRadius().

Referenced by Isis::ControlNetFilter::CubeDistanceFilter(), Isis::FindTool::distancePerPixel(), Isis::QnetPointDistanceFilter::filter(), Isis::QnetCubeDistanceFilter::filter(), Isis::SpatialPlotTool::getSpatialStatistics(), and Isis::ControlNetFilter::PointDistanceFilter().

Distance Isis::SurfacePoint::GetDistanceToPoint ( const SurfacePoint other,
const Distance sphereRadius 
) const

Computes and returns the distance between two surface points, assuming both points are on a sphere with the given radius.

This uses the haversine formula to compute the distance. Using a spherical model gives errors typically <1%

Definition at line 1069 of file SurfacePoint.cpp.

References GetLatitude(), GetLongitude(), and Isis::Angle::radians().

double Isis::SurfacePoint::GetLatWeight ( ) const

Return latitude weight for bundle adjustment Units are 1/(radians)^2.

Definition at line 996 of file SurfacePoint.cpp.

References _FILEINFO_.

Referenced by Isis::BundleAdjust::InitializePointWeights(), and Isis::BundleAdjust::SetParameterWeights().

double Isis::SurfacePoint::GetLocalRadiusWeight ( ) const

Return radius weight for bundle adjustment Units are 1/(meters)^2.

Definition at line 1028 of file SurfacePoint.cpp.

References _FILEINFO_.

Referenced by Isis::BundleAdjust::InitializePointWeights(), and Isis::BundleAdjust::SetParameterWeights().

double Isis::SurfacePoint::GetLonWeight ( ) const

Return longitude weight for bundle adjustment Units are 1/(radians)^2.

Definition at line 1012 of file SurfacePoint.cpp.

References _FILEINFO_.

Referenced by Isis::BundleAdjust::InitializePointWeights(), and Isis::BundleAdjust::SetParameterWeights().

void Isis::SurfacePoint::InitCovariance ( )
private

Initialize the variance/covariance matrices.

Definition at line 214 of file SurfacePoint.cpp.

void Isis::SurfacePoint::InitPoint ( )
private

Initialize a surface point.

Definition at line 224 of file SurfacePoint.cpp.

void Isis::SurfacePoint::InitRadii ( )
private

Initialize the target surface radii.

Definition at line 234 of file SurfacePoint.cpp.

void Isis::SurfacePoint::ResetLocalRadius ( const Distance radius)

This method resets the local radius of a SurfacePoint.

Parameters
radiusThe new local radius value to set

Definition at line 751 of file SurfacePoint.cpp.

References _FILEINFO_, Isis::Distance::isValid(), and Isis::Distance::kilometers().

void Isis::SurfacePoint::SetRadii ( const Distance majorRadius,
const Distance minorRadius,
const Distance polarRadius 
)

Reset the radii of the surface body of the surface point.

Parameters
majorAxisThe semi-major axis of the surface model
minorAxisThe semi-minor axis of the surface model
polarAxisThe polar axis of the surface model

Definition at line 710 of file SurfacePoint.cpp.

References _FILEINFO_, and Isis::Distance::isValid().

Referenced by Isis::ControlPoint::ControlPoint(), Isis::ControlNetVersioner::ConvertVersion1ToVersion2(), Isis::QnetSetAprioriDialog::setApriori(), Isis::ControlPoint::SetAprioriSurfacePoint(), Isis::ControlNetFileV0002::toPvl(), and Isis::QnetTool::updateSurfacePointInfo().

void Isis::SurfacePoint::SetRectangular ( const Displacement x,
const Displacement y,
const Displacement z,
const Distance xSigma = Distance(),
const Distance ySigma = Distance(),
const Distance zSigma = Distance() 
)

Set surface point in rectangular body-fixed coordinates wtih optional sigmas.

Parameters
xx value of body-fixed coordinate of surface point
yy value of body-fixed coordinate of surface point
zz value of body-fixed coordinate of surface point
xSigmax sigma of body-fixed coordinate of surface point
ySigmay sigma of body-fixed coordinate of surface point
zSigmaz sigma of body-fixed coordinate of surface point
Returns
void

Definition at line 299 of file SurfacePoint.cpp.

References Isis::Distance::isValid().

Referenced by Isis::ControlPoint::ComputeApriori(), Isis::ControlNetVersioner::ConvertVersion1ToVersion2(), and Isis::ControlNetFileV0002::toPvl().

void Isis::SurfacePoint::SetRectangularMatrix ( const boost::numeric::ublas::symmetric_matrix< double, boost::numeric::ublas::upper > &  covar)

Set rectangular covariance matrix.

Parameters
covarRectangular variance/covariance matrix (units are m**2)
Returns
void

Definition at line 361 of file SurfacePoint.cpp.

References _FILEINFO_.

Referenced by Isis::ControlPoint::ControlPoint(), and Isis::ControlNetFileV0002::toPvl().

void Isis::SurfacePoint::SetRectangularPoint ( const Displacement x,
const Displacement y,
const Displacement z 
)
private

This is a private method to set a surface point in rectangular, body-fixed coordinates.

This method isolates the procedure for setting a rectangular point in one place.

Parameters
xx value of body-fixed coordinate of surface point
yy value of body-fixed coordinate of surface point
zz value of body-fixed coordinate of surface point
Returns
void

Definition at line 253 of file SurfacePoint.cpp.

References _FILEINFO_, and Isis::Displacement::isValid().

void Isis::SurfacePoint::SetRectangularSigmas ( const Distance xSigma,
const Distance ySigma,
const Distance zSigma 
)

Set surface point and sigmas in rectangular coordinates and convert to planetocentric.

Set the rectangular sigmas into the rectangular variance/covariance matrix.

Parameters
xSigmax sigma of body-fixed coordinate of surface point
ySigmay sigma of body-fixed coordinate of surface point
zSigmaz sigma of body-fixed coordinate of surface point

Definition at line 335 of file SurfacePoint.cpp.

References _FILEINFO_, Isis::Distance::isValid(), and Isis::Distance::meters().

void Isis::SurfacePoint::SetSpherical ( const Latitude lat,
const Longitude lon,
const Distance radius,
const Angle latSigma = Angle(),
const Angle lonSigma = Angle(),
const Distance radiusSigma = Distance() 
)

Set surface point and covariance matrix in planetocentric coordinates and convert to rectangular (Latitude, Longitude in degrees, Radius in meters; matrix in radians and radians**2)

Set surface point in spherical body-fixed coordinates (lat/lon/radius) wtih optional sigmas.

Parameters
latBody-fixed latitude of surface point
lonBody-fixed longitude of surface point
radiusLocal radius of surface point
latSigmaLatitude sigma of of spherical coordinate of surface point
lonSigmaLongitude sigma of of spherical coordinate of surface point
radiusSigmaLocal radius sigma of of spherical coordinate of surface point

Definition at line 469 of file SurfacePoint.cpp.

References Isis::Angle::isValid(), and Isis::Distance::isValid().

Referenced by Isis::ControlNetFilter::PointDistanceFilter(), Isis::ControlNetFilter::PointLatLonFilter(), and Isis::Sensor::SetUniversalGround().

void Isis::SurfacePoint::SetSphericalCoordinates ( const Latitude lat,
const Longitude lon,
const Distance radius 
)

Update spherical coordinates (lat/lon/radius)

Parameters
lat
lon
radius

Definition at line 503 of file SurfacePoint.cpp.

Referenced by Isis::BundleAdjust::applyParameterCorrections_CHOLMOD(), Isis::BundleAdjust::applyParameterCorrections_SPECIALK(), and Isis::BundleAdjust::Update().

void Isis::SurfacePoint::SetSphericalMatrix ( const boost::numeric::ublas::symmetric_matrix< double, boost::numeric::ublas::upper > &  covar)

Set spherical covariance matrix.

Parameters
covarSpherical variance/covariance matrix (radians**2)
Returns
void

Definition at line 586 of file SurfacePoint.cpp.

References _FILEINFO_.

Referenced by Isis::BundleAdjust::formNormals2_CHOLMOD(), and Isis::BundleAdjust::formNormals2_SPECIALK().

void Isis::SurfacePoint::SetSphericalPoint ( const Latitude lat,
const Longitude lon,
const Distance radius 
)
private

This is a private method to set a surface point in spherical (lat/lon/radius), body-fixed coordinates.

This method isolates the procedure for setting a spherical point in one place.

Parameters
latBody-fixed latitude of surface point
lonBody-fixed longitude of surface point
radiusLocal radius of surface point
Returns
void

Definition at line 434 of file SurfacePoint.cpp.

References _FILEINFO_, Isis::Angle::isValid(), Isis::Distance::isValid(), Isis::Distance::kilometers(), and Isis::Angle::radians().

void Isis::SurfacePoint::SetSphericalSigmas ( const Angle latSigma,
const Angle lonSigma,
const Distance radiusSigma 
)

Set the spherical sigmas into the spherical variance/covariance matrix.

Parameters
latSigmaLatitude sigma of body-fixed coordinate of surface point
lonSigmaLongitude sigma of body-fixed coordinate of surface point
radiusSigmaRadius sigma of body-fixed coordinate of surface point

Definition at line 517 of file SurfacePoint.cpp.

References Isis::Angle::isValid(), Isis::Distance::isValid(), Isis::Distance::meters(), and Isis::Angle::radians().

void Isis::SurfacePoint::SetSphericalSigmasDistance ( const Distance latSigma,
const Distance lonSigma,
const Distance radiusSigma 
)

Set the spherical sigmas (in meters) into the spherical variance/covariance matrix.

Parameters
latSigmaLatitude sigma of body-fixed coordinate of surface point in meters
lonSigmaLongitude sigma of body-fixed coordinate of surface point in meters
radiusSigmaRadius sigma of body-fixed coordinate of surface point in meters

Definition at line 555 of file SurfacePoint.cpp.

References _FILEINFO_.

Referenced by Isis::ControlNetVersioner::ConvertVersion1ToVersion2(), Isis::BundleAdjust::errorPropagation_CHOLMOD(), Isis::BundleAdjust::errorPropagation_SPECIALK(), Isis::QnetSetAprioriDialog::setApriori(), and Isis::BundleAdjust::SetPostBundleSigmas().

void Isis::SurfacePoint::ToNaifArray ( double  naifOutput[3]) const

A naif array is a c-style array of size 3.

The element types are double... keep in mind a SpiceDouble is a double. The values' units are kilometers because that is the unit naif works in. The first element is X, the second Y, and the third Z.

Parameters
naifOutputThe naif array to populate with the surface point's XYZ position.

Definition at line 668 of file SurfacePoint.cpp.

References _FILEINFO_.

Referenced by Isis::DemShape::calculateLocalNormal(), Isis::NaifDskShape::ellipsoidNormal(), Isis::TriangularPlate::hasPoint(), Isis::TriangularPlate::point(), and Isis::RadarGroundMap::SetGround().

Member Data Documentation

boost::numeric::ublas::symmetric_matrix<double,boost::numeric::ublas::upper>* Isis::SurfacePoint::p_rectCovar
private

3x3 upper triangular covariance matrix rectangular coordinates

Definition at line 213 of file SurfacePoint.h.

Referenced by SurfacePoint().

boost::numeric::ublas::symmetric_matrix<double,boost::numeric::ublas::upper>* Isis::SurfacePoint::p_sphereCovar
private

3x3 upper triangular covariance matrix ocentric coordinates

Definition at line 216 of file SurfacePoint.h.

Referenced by SurfacePoint().


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