USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::VimsGroundMap Class Reference

Convert between undistorted focal plane and ground coordinates. More...

#include <VimsGroundMap.h>

Inheritance diagram for Isis::VimsGroundMap:
Inheritance graph
Collaboration diagram for Isis::VimsGroundMap:
Collaboration graph

Public Types

enum  PartialType { WRT_Latitude, WRT_Longitude, WRT_Radius }
 

Public Member Functions

 VimsGroundMap (Camera *parent, Pvl &lab)
 Constructs the VimsGroundMap object.
 
virtual ~VimsGroundMap ()
 Destroys the VimsGroundMap object.
 
virtual bool SetFocalPlane (const double ux, const double uy, const double uz)
 Compute ground position from focal plane coordinate.
 
virtual bool SetGround (const Latitude &lat, const Longitude &lon)
 Compute undistorted focal plane coordinate from ground position.
 
virtual bool SetGround (const SurfacePoint &surfacePoint)
 Compute undistorted focal plane coordinate from ground position.
 
void Init (Pvl &lab)
 Initialize vims camera model.
 
virtual bool GetXY (const SurfacePoint &spoint, double *cudx, double *cudy)
 Compute undistorted focal plane coordinate from ground position using current Spice from SetImage call.
 
virtual bool GetXY (const double lat, const double lon, const double radius, double *cudx, double *cudy)
 Compute undistorted focal plane coordinate from ground position using current Spice from SetImage call.
 
virtual bool GetdXYdPosition (const SpicePosition::PartialType varType, int coefIndex, double *cudx, double *cudy)
 Compute derivative w/r to position of focal plane coordinate from ground position using current Spice from SetImage call.
 
virtual bool GetdXYdOrientation (const SpiceRotation::PartialType varType, int coefIndex, double *cudx, double *cudy)
 Compute derivative of focal plane coordinate w/r to orientation from ground position using current Spice from SetImage call.
 
virtual bool GetdXYdPoint (std::vector< double > d_lookB, double *cudx, double *cudy)
 Compute derivative of focal plane coordinate w/r to ground point from ground position using current Spice from SetImage call.
 
std::vector< double > PointPartial (SurfacePoint spoint, PartialType wrt)
 Compute derivative with respect to indicated variable of conversion function from lat/lon/rad to rectangular coord.
 
double DQuotient (std::vector< double > &look, std::vector< double > &dlook, int index)
 Convenience method for quotient rule applied to look vector.
 
double FocalPlaneX () const
 Return undistorted focal plane x.
 
double FocalPlaneY () const
 Return undistorted focal plane y.
 

Protected Attributes

Camerap_camera
 
double p_focalPlaneX
 
double p_focalPlaneY
 

Private Member Functions

void LookDirection (double v[3])
 Determines the look direction in the camera coordinate system.
 

Private Attributes

SpiceDouble p_etStart
 Start ephemeris time.
 
double p_exposureDuration
 Exposure duration.
 
double p_interlineDelay
 
   InterlineDelayDuration keyword value from

the instrument group of the labels, divided by 1000

 
double p_ux
 Distorted focal plane x, in millimeters.
 
double p_uy
 Distorted focal plane y, in millimeters.
 
double p_uz
 Distorted focal plane z, in millimeters.
 
double p_xPixSize
 X pixel size.
 
double p_yPixSize
 Y pixel size.
 
double p_xBore
 X boresight.
 
double p_yBore
 Y boresight.
 
QString p_channel
 Channel keyword value from the instrument group of the labels.
 
double p_visExp
 VIS exposure duration, divided by 1000.
 
double p_irExp
 IR exposure duration, divided by 1000.
 
int p_nsUv
 Normal or high resolution sample uv.
 
int p_nlUv
 Normal or high resolution line uv.
 
int p_swathWidth
 SwathWidth keyword value from the instrument group of the labels.
 
int p_swathLength
 SwathLength keyword value from the instrument group of the labels.
 
int p_camSampOffset
 Sample offset.
 
int p_camLineOffset
 Line offset.
 
double p_minX
 
double p_maxX
 
double p_minY
 
double p_maxY
 
double p_minZ
 
double p_maxZ
 
QVector3D p_xyzMap [64][64]
 

Detailed Description

Convert between undistorted focal plane and ground coordinates.

This base class is used to convert between undistorted focal plane coordinates (x/y) in millimeters and ground coordinates lat/lon. This class handles the case of framing cameras.

See Also
Camera
VimsCamera
Author
2006-03-16 Tracie Sucharski
History:

2006-03-16 Tracie Sucharski Original version

2008-02-05 Tracie Sucharski, Replaced unitVector files with Rick McCloskey's code to calculate look direction.

2008-06-18 Steven Lambright Fixed documentation

2009-04-06 Steven Lambright Fixed problem that caused double deletion of sky map / ground map.

2009-08-06 Tracie Sucharski, Bug in unit vector change made on 2008-02-05, had the incorrect boresight for VIS Hires.

2011-02-08 Steven Lambright & Debbie Cook, Added WrapWorldToBeClose and refactored to use the Latitude and Longitude classes.

2011-05-03 Jeannie Walldren - Updated documentation. Removed Cassini namespace wrap inside Isis namespace.

2011-10-19 Steven Lambright - Added common sense check to constructor to at least provide a string explanation for why their program is going to crash when the original cube makes no sense. Since the exception is in the constructor the error will probably lead to an alternate seg fault.

2012-07-06 Debbie A. Cook, Updated Spice members to be more compliant with Isis coding standards. References #972.

2012-09-10 Ken Edmundson, Added new methods, SetGroundwithLatitudeLongitude and SetGroundwithRadiusLongitude to support rings data.

2012-12-03 Tracie Sucharski - Added error check to SetGround method. Returns false if none of the pixel centers in the cube intersect with the planet. Fixes #1306.

2013-07-24 Tracie Sucharski - Fix bug in camera model which causes a problems finding either north or south poles in images. References #1289.

2013-08-12 Tracie Sucharski - Change all computations base on latitude and longitude to x, y and z. This takes care of pole problems and improves accuracy. Fixes #1289.

2014-04-09 Tracie Sucharski - When changing the camera model from lat/lon to x/y/z calculations the range checking was removed. This caused extra pixels to be projected into incorrect positions when doing global projections. Range checking was put back in using x/y/z values. References #1289.

Definition at line 91 of file VimsGroundMap.h.

Constructor & Destructor Documentation

Isis::VimsGroundMap::VimsGroundMap ( Camera parent,
Pvl lab 
)

Constructs the VimsGroundMap object.

Parameters
parentA pointer to the parent Camera object
labPvl labels for the image

Definition at line 54 of file VimsGroundMap.cpp.

References _FILEINFO_, Isis::Camera::ParentLines(), Isis::Camera::ParentSamples(), and Isis::IException::Programmer.

Isis::VimsGroundMap::~VimsGroundMap ( )
virtual

Destroys the VimsGroundMap object.

Definition at line 76 of file VimsGroundMap.cpp.

Member Function Documentation

double Isis::CameraGroundMap::DQuotient ( std::vector< double > &  look,
std::vector< double > &  dlook,
int  index 
)
inherited

Convenience method for quotient rule applied to look vector.

This method will compute the derivative of the following function (coordinate x or y) / (coordinate z)

Parameters
looklook vector in camera frame
dlookderivative of look vector in camera frame
indexvector value to differentiate
Returns
derivative

Definition at line 385 of file CameraGroundMap.cpp.

double Isis::CameraGroundMap::FocalPlaneX ( ) const
inlineinherited

Return undistorted focal plane x.

Definition at line 113 of file CameraGroundMap.h.

Referenced by Isis::Camera::RawFocalPlanetoImage().

double Isis::CameraGroundMap::FocalPlaneY ( ) const
inlineinherited

Return undistorted focal plane y.

Definition at line 118 of file CameraGroundMap.h.

Referenced by Isis::Camera::RawFocalPlanetoImage().

bool Isis::CameraGroundMap::GetdXYdOrientation ( const SpiceRotation::PartialType  varType,
int  coefIndex,
double *  dx,
double *  dy 
)
virtualinherited

Compute derivative of focal plane coordinate w/r to orientation from ground position using current Spice from SetImage call.

This method will compute the derivative of the undistorted focal plane coordinate for a ground position with respect to the instrument orientation, using the current Spice settings (time and kernels) without resetting the current point values for lat/lon/radius/x/y.

Parameters
varTypeenumerated partial type (definitions in SpicePosition)
coefIndexcoefficient index of fit polynomial
*dxpointer to partial derivative of undistorted focal plane x
*dypointer to partial derivative of undistorted focal plane y
Returns
conversion was successful

Definition at line 280 of file CameraGroundMap.cpp.

References Isis::SpiceRotation::ReferenceVector(), and Isis::SpiceRotation::ToReferencePartial().

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

bool Isis::CameraGroundMap::GetdXYdPoint ( std::vector< double >  d_lookB,
double *  dx,
double *  dy 
)
virtualinherited

Compute derivative of focal plane coordinate w/r to ground point from ground position using current Spice from SetImage call.

This method will compute the derivative of the undistorted focal plane coordinate for a ground position with respect to lat, lon, or radius, using the current Spice settings (time and kernels) without resetting the current point values for lat/lon/radius/x/y.

Parameters
varTypeenumerated partial type (definitions in SpicePosition)
coefIndexcoefficient index of fit polynomial
*dxpointer to partial derivative of undistorted focal plane x
*dypointer to partial derivative of undistorted focal plane y
Returns
conversion was successful

Reimplemented in Isis::RadarGroundMap.

Definition at line 312 of file CameraGroundMap.cpp.

References Isis::SpiceRotation::J2000Vector(), and Isis::SpiceRotation::ReferenceVector().

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

bool Isis::CameraGroundMap::GetdXYdPosition ( const SpicePosition::PartialType  varType,
int  coefIndex,
double *  dx,
double *  dy 
)
virtualinherited

Compute derivative w/r to position of focal plane coordinate from ground position using current Spice from SetImage call.

This method will compute the derivative of the undistorted focal plane coordinate for a ground position with respect to a spacecraft position coordinate, using the current Spice settings (time and kernels) without resetting the current point values for lat/lon/radius/x/y.

Parameters
varTypeenumerated partial type (definitions in SpicePosition)
coefIndexcoefficient index of fit polynomial
*dxpointer to partial derivative of undistorted focal plane x
*dypointer to partial derivative of undistorted focal plane y
Returns
conversion was successful

Reimplemented in Isis::RadarGroundMap.

Definition at line 243 of file CameraGroundMap.cpp.

References Isis::SpicePosition::CoordinatePartial(), and Isis::SpiceRotation::ReferenceVector().

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

bool Isis::CameraGroundMap::GetXY ( const SurfacePoint point,
double *  cudx,
double *  cudy 
)
virtualinherited

Compute undistorted focal plane coordinate from ground position using current Spice from SetImage call.

This method will compute the undistorted focal plane coordinate for a ground position, using the current Spice settings (time and kernels) without resetting the current point values for lat/lon/radius/p_pB/x/y. The class value for p_look is set by this method.

Parameters
point
Returns
conversion was successful

Reimplemented in Isis::RadarGroundMap.

Definition at line 146 of file CameraGroundMap.cpp.

References Isis::Displacement::kilometers(), Isis::PI(), and Isis::SpiceRotation::ReferenceVector().

Referenced by Isis::BundleAdjust::AddPartials(), Isis::BundleAdjust::ComputePartials_DC(), Isis::ControlPoint::ComputeResiduals(), and Isis::ControlPoint::ComputeResiduals_Millimeters().

bool Isis::CameraGroundMap::GetXY ( const double  lat,
const double  lon,
const double  radius,
double *  cudx,
double *  cudy 
)
virtualinherited

Compute undistorted focal plane coordinate from ground position using current Spice from SetImage call.

This method will compute the undistorted focal plane coordinate for a ground position, using the current Spice settings (time and kernels) without resetting the current point values for lat/lon/radius/p_pB/x/y. The class value for p_look is set by this method.

Parameters
latLatitude in degrees
lonLongitude in degrees
radius
Returns
conversion was successful

Definition at line 220 of file CameraGroundMap.cpp.

void Isis::VimsGroundMap::Init ( Pvl lab)

Initialize vims camera model.

Parameters
[in]lab(Pvl &) Cube Pvl label
Exceptions
iException::Io- "Cannot process NYQUIST(undersampled) mode "
History:

2007-04-16 Tracie Sucharski - Look for unit vectors in the proper directory.

2007-04-18 Tracie Sucharski, The inaccuracy of the 15 Mhz clock (exposure , interline_delay) is already taken care of in the labels values, so remove the adjustment from the code (exp * 1.01725). *Reference: email from John Ivens 11/27/2006.

2007-04-19 Tracie Sucharski, Swap bytes on unit vectors. They are currently LSB binary files. ???Todo:??? Convert unit vectors to text files.

2008-02-05 Tracie Sucharski, Replaced unitVector files with Rick McCloskey's code to calculate look direction.

2009-08-06 Tracie Sucharski, Bug in unit vector change made on 2008-02-05, had the incorrect boresight for VIS Hires.

2013-09-09 Tracie Sucharski, Turns out the times in the labels are NOT corrected, so the corrections NEED to happen in the code. There was discussion among UofA Vims and PDS about reproducing PDS archive with labels corrected, but the decision was made to perform the correction in the code and leave the archive alone. Some history: 08-23-2004 Rick McCloskey gave me the correction to put in the code since he said the label values were incorrect. 11-27-2006 John Ivens said the labels values were corrected, so I removed the correction factor from the code. For more info, See previous history entries: 2007-04-18.

2014-04-09 Tracie Sucharski - When converting the camera model from lat/lon to x/y/z calculations, the range check in the SetGround method was removed. When creating global projections, the pixel data would be replicated in incorrect locations due to the least squares fitting always finding a fit, even if it's incorrect. The range checking was added back in using x/y/z min/max values. However, this caused the pole not to be found, so the min/max z values are adjusted to include the pole if they are within 1 km of the pole. This value was chosen through trial and error, and I have concerns that this may need to be adjusted for images with different resolutions. I think it would just cause a few extra pixels at the edge worse case scenario.

Definition at line 128 of file VimsGroundMap.cpp.

References _FILEINFO_, Isis::Sensor::Coordinate(), Isis::iTime::Et(), Isis::PvlObject::findGroup(), Isis::Spice::getClockTime(), Isis::Camera::IgnoreProjection(), Isis::Distance::kilometers(), Isis::Null, p_camLineOffset, p_camSampOffset, p_channel, p_etStart, p_interlineDelay, p_irExp, p_swathLength, p_swathWidth, p_visExp, p_xBore, p_xPixSize, p_yBore, p_yPixSize, Isis::Camera::ParentLines(), Isis::Camera::ParentSamples(), Isis::IException::Programmer, Isis::Spice::radii(), Isis::Camera::SetImage(), Isis::Sensor::setTime(), Isis::toDouble(), and Isis::PvlObject::Traverse.

void Isis::VimsGroundMap::LookDirection ( double  v[3])
private

Determines the look direction in the camera coordinate system.

Parameters
[out]vLook direction vector in camera coordinates

This method will compute the look direction vector in the camera coordinate system. This code was converted from Rick McCloskey's point_tbl c code.

History:
2008-01-031 Tracie Sucharski - Converted Rick's code rather than using the unitVector files from Rick.

Definition at line 523 of file VimsGroundMap.cpp.

References Isis::HALFPI(), p_camLineOffset, p_camSampOffset, p_ux, p_uy, p_xBore, p_xPixSize, p_yBore, and p_yPixSize.

Referenced by SetFocalPlane().

std::vector< double > Isis::CameraGroundMap::PointPartial ( SurfacePoint  spoint,
PartialType  wrt 
)
inherited

Compute derivative with respect to indicated variable of conversion function from lat/lon/rad to rectangular coord.

Parameters
latplanetocentric latitude in degrees
lonplanetocentric longitude in degrees
radiuslocal radius in meters
wrttake derivative with respect to this value
Returns
partialDerivative

Definition at line 343 of file CameraGroundMap.cpp.

References Isis::SurfacePoint::GetLatitude(), Isis::SurfacePoint::GetLocalRadius(), Isis::SurfacePoint::GetLongitude(), Isis::Distance::kilometers(), and Isis::Angle::radians().

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

bool Isis::VimsGroundMap::SetFocalPlane ( const double  ux,
const double  uy,
const double  uz 
)
virtual

Compute ground position from focal plane coordinate.

This method will compute the ground position given an undistorted focal plane coordinate. Note that the latitude/longitude value can be obtained from the camera class passed into the constructor.

Parameters
uxDistorted focal plane x in millimeters
uyDistorted focal plane y in millimeters
uzDistorted focal plane z in millimeters
Returns
bool Indicates whether the conversion was successful
History:

2008-01-02 Tracie Sucharski - Check incoming pixel for validity against edge of pixel not center.

2008-02-05 Tracie Sucharski, Replaced unitVector files with Rick McCloskey's code to calculate look direction

2008-02-14 Tracie Sucharski, Change imgSamp/imgLine to double so that fractional pixels are used in calculations.

Reimplemented from Isis::CameraGroundMap.

Definition at line 299 of file VimsGroundMap.cpp.

References LookDirection(), p_channel, p_etStart, p_interlineDelay, p_irExp, p_swathWidth, p_ux, p_uy, p_uz, p_visExp, Isis::Camera::ParentLines(), Isis::Camera::ParentSamples(), Isis::Sensor::SetLookDirection(), and Isis::Sensor::setTime().

bool Isis::VimsGroundMap::SetGround ( const Latitude lat,
const Longitude lon 
)
virtual

Compute undistorted focal plane coordinate from ground position.

Parameters
latPlanetocentric latitude in degrees
lonPlanetocentric longitude in degrees
Returns
bool Indicates whether the conversion was successful
History:

2007-04-18 Tracie Sucharski - Added check for reasonable match when attempting to find closest lat/lon in map arrays.

2007-09-14 Tracie Sucharski - Added check for longitude outside min/max bounds. Don't know why this wasn't put in before (lat check was in), was it oversight, or did I take it out for some reason???

2007-12-14 Tracie Sucharski - Remove resolution test, too image dependent and the resolution for vims is incorrect due to the instrument having rectangular pixels.

2008-01-02 Tracie Sucharski - Check validity of resulting sample and line against edge of starting ending pixels (0.5/Parent+0.5) instead of center of pixels.

2012-12-03 Tracie Sucharski - Check for valid minLat/maxLat, minLon/maxLon. If none are valid, this means the latMap and lonMap have no valid data, therefore we cannot back project, so return false.

2014-04-08 Tracie Sucharski - Change the sanity check made on 2012-12-03 from lat/lon to xyz.

Reimplemented from Isis::CameraGroundMap.

Definition at line 371 of file VimsGroundMap.cpp.

References Isis::LeastSquares::AddKnown(), Isis::Angle::degrees(), Isis::LeastSquares::Evaluate(), Isis::Sensor::HasSurfaceIntersection(), Isis::Camera::IgnoreProjection(), Isis::Distance::kilometers(), Isis::LeastSquares::Knowns(), Isis::Sensor::LocalRadius(), Isis::ShapeModel::name(), Isis::Camera::ParentLines(), Isis::Camera::ParentSamples(), Isis::Angle::radians(), Isis::Camera::SetImage(), Isis::Target::shape(), Isis::LeastSquares::Solve(), and Isis::Spice::target().

Referenced by SetGround().

bool Isis::VimsGroundMap::SetGround ( const SurfacePoint surfacePoint)
virtual

Compute undistorted focal plane coordinate from ground position.

Parameters
surfacePointGround surface point
Returns
bool Indicates whether the conversion was successful.

Reimplemented from Isis::CameraGroundMap.

Definition at line 504 of file VimsGroundMap.cpp.

References Isis::SurfacePoint::GetLatitude(), Isis::SurfacePoint::GetLongitude(), and SetGround().

Member Data Documentation

int Isis::VimsGroundMap::p_camLineOffset
private

Line offset.

Definition at line 136 of file VimsGroundMap.h.

Referenced by Init(), and LookDirection().

int Isis::VimsGroundMap::p_camSampOffset
private

Sample offset.

Definition at line 135 of file VimsGroundMap.h.

Referenced by Init(), and LookDirection().

QString Isis::VimsGroundMap::p_channel
private

Channel keyword value from the instrument group of the labels.

Possible values are IR or VIS

Definition at line 125 of file VimsGroundMap.h.

Referenced by Init(), and SetFocalPlane().

SpiceDouble Isis::VimsGroundMap::p_etStart
private

Start ephemeris time.

Definition at line 110 of file VimsGroundMap.h.

Referenced by Init(), and SetFocalPlane().

double Isis::VimsGroundMap::p_exposureDuration
private

Exposure duration.

Definition at line 112 of file VimsGroundMap.h.

double Isis::VimsGroundMap::p_interlineDelay
private

   InterlineDelayDuration keyword value from

the instrument group of the labels, divided by 1000

Definition at line 113 of file VimsGroundMap.h.

Referenced by Init(), and SetFocalPlane().

double Isis::VimsGroundMap::p_irExp
private

IR exposure duration, divided by 1000.

Definition at line 128 of file VimsGroundMap.h.

Referenced by Init(), and SetFocalPlane().

int Isis::VimsGroundMap::p_nlUv
private

Normal or high resolution line uv.

Definition at line 130 of file VimsGroundMap.h.

int Isis::VimsGroundMap::p_nsUv
private

Normal or high resolution sample uv.

Definition at line 129 of file VimsGroundMap.h.

int Isis::VimsGroundMap::p_swathLength
private

SwathLength keyword value from the instrument group of the labels.

This will be image size unless occultation image

Definition at line 133 of file VimsGroundMap.h.

Referenced by Init().

int Isis::VimsGroundMap::p_swathWidth
private

SwathWidth keyword value from the instrument group of the labels.

This will be image size unless occultation image

Definition at line 131 of file VimsGroundMap.h.

Referenced by Init(), and SetFocalPlane().

double Isis::VimsGroundMap::p_ux
private

Distorted focal plane x, in millimeters.

Definition at line 116 of file VimsGroundMap.h.

Referenced by LookDirection(), and SetFocalPlane().

double Isis::VimsGroundMap::p_uy
private

Distorted focal plane y, in millimeters.

Definition at line 117 of file VimsGroundMap.h.

Referenced by LookDirection(), and SetFocalPlane().

double Isis::VimsGroundMap::p_uz
private

Distorted focal plane z, in millimeters.

Definition at line 118 of file VimsGroundMap.h.

Referenced by SetFocalPlane().

double Isis::VimsGroundMap::p_visExp
private

VIS exposure duration, divided by 1000.

Definition at line 127 of file VimsGroundMap.h.

Referenced by Init(), and SetFocalPlane().

double Isis::VimsGroundMap::p_xBore
private

X boresight.

Definition at line 122 of file VimsGroundMap.h.

Referenced by Init(), and LookDirection().

double Isis::VimsGroundMap::p_xPixSize
private

X pixel size.

Definition at line 120 of file VimsGroundMap.h.

Referenced by Init(), and LookDirection().

double Isis::VimsGroundMap::p_yBore
private

Y boresight.

Definition at line 123 of file VimsGroundMap.h.

Referenced by Init(), and LookDirection().

double Isis::VimsGroundMap::p_yPixSize
private

Y pixel size.

Definition at line 121 of file VimsGroundMap.h.

Referenced by Init(), and LookDirection().


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