Permalink
Browse files

IsisIO: Update to ISIS 3.4.1

They're just slowly renaming their methods. I'm sure it's hell for
everyone involved.
  • Loading branch information...
1 parent dd6c207 commit 5ae437becf2243c72ca386a8d09f50837ea10c4d Zack Moratto committed Aug 29, 2012
View
40 src/asp/IsisIO/IsisAdjustCameraModel.cc
@@ -56,7 +56,7 @@ IsisAdjustCameraModel::IsisAdjustCameraModel( std::string cube_filename,
vw_throw( NoImplErr() << "Don't support map projected images" );
// Adjusting time offset so equations are reference from middle of cache
- double middle_et = m_camera->CacheStartTime().Et() + (m_camera->CacheEndTime().Et()-m_camera->CacheStartTime().Et())/2.0;
+ double middle_et = m_camera->cacheStartTime().Et() + (m_camera->cacheEndTime().Et()-m_camera->cacheStartTime().Et())/2.0;
m_position_f->set_time_offset( middle_et );
m_pose_f->set_time_offset( middle_et );
}
@@ -74,11 +74,11 @@ void IsisAdjustCameraModel::SetTime( Vector2 const& px,
if ( calc ) {
// Calculating Spacecraft position and pose
- m_camera->InstrumentPosition(&m_center[0]);
+ m_camera->instrumentPosition(&m_center[0]);
m_center *= 1000;
- std::vector<double> rot_inst = m_camera->InstrumentRotation()->Matrix();
- std::vector<double> rot_body = m_camera->BodyRotation()->Matrix();
+ std::vector<double> rot_inst = m_camera->instrumentRotation()->Matrix();
+ std::vector<double> rot_body = m_camera->bodyRotation()->Matrix();
MatrixProxy<double,3,3> R_inst(&(rot_inst[0]));
MatrixProxy<double,3,3> R_body(&(rot_body[0]));
m_pose = Quat( R_inst*transpose(R_body) );
@@ -96,7 +96,7 @@ Vector2 IsisAdjustCameraModel::point_to_pixel( Vector3 const& point ) const {
if ( m_camera->GetCameraType() == 2 ) {
// Use own LMA to find correct ephemeris time. This also gives the
// ability to use own functions for ET.
- double start_e = m_camera->CacheStartTime().Et() + (m_camera->CacheEndTime().Et()-m_camera->CacheStartTime().Et())/2.0;
+ double start_e = m_camera->cacheStartTime().Et() + (m_camera->cacheEndTime().Et()-m_camera->cacheStartTime().Et())/2.0;
// Build LMA
EphemerisLMA model( point, m_camera, m_distortmap,
@@ -114,26 +114,26 @@ Vector2 IsisAdjustCameraModel::point_to_pixel( Vector3 const& point ) const {
MathErr() << " Unable to project point into linescan camera " );
// Converting now to pixel
- m_camera->SetTime( Isis::iTime( solution_e[0] ) );
+ m_camera->setTime( Isis::iTime( solution_e[0] ) );
} else if ( m_camera->GetCameraType() != 0 ) {
vw_throw( NoImplErr() << "IsisAdjustCameraModel::point_to_pixel does not support any cmaeras other than LineScane and Frame" );
}
// Pulling out camera position for current time
- m_camera->InstrumentPosition(&m_center[0]);
+ m_camera->instrumentPosition(&m_center[0]);
m_center *= 1000;
// Pulling out camera pose
- std::vector<double> rot_inst = m_camera->InstrumentRotation()->Matrix();
- std::vector<double> rot_body = m_camera->BodyRotation()->Matrix();
+ std::vector<double> rot_inst = m_camera->instrumentRotation()->Matrix();
+ std::vector<double> rot_body = m_camera->bodyRotation()->Matrix();
MatrixProxy<double,3,3> R_inst(&(rot_inst[0]));
MatrixProxy<double,3,3> R_body(&(rot_body[0]));
m_pose = Quat(R_inst*transpose(R_body));
- Vector3 angles = m_pose_f->evaluate( m_camera->Time().Et() );
+ Vector3 angles = m_pose_f->evaluate( m_camera->time().Et() );
Quat pose_adj( m_pose*math::axis_angle_to_quaternion( angles ) );
// Actually projecting point now
- Vector3 look = normalize( point - (m_center+m_position_f->evaluate(m_camera->Time().Et())) );
+ Vector3 look = normalize( point - (m_center+m_position_f->evaluate(m_camera->time().Et())) );
look = pose_adj.rotate( look );
look = m_camera->FocalLength() * ( look / look[2] );
m_distortmap->SetUndistortedFocalPlane( look[0], look[1] );
@@ -165,7 +165,7 @@ Vector3 IsisAdjustCameraModel::pixel_to_vector( Vector2 const& pix ) const {
result = normalize( result );
// Apply rotation of image camera
- Vector3 angles = m_pose_f->evaluate( m_camera->Time().Et() );
+ Vector3 angles = m_pose_f->evaluate( m_camera->time().Et() );
result = inverse( m_pose*math::axis_angle_to_quaternion(angles) ).rotate( result );
return result;
}
@@ -175,15 +175,15 @@ IsisAdjustCameraModel::camera_center( Vector2 const& pix ) const {
// Converting to ISIS index
Vector2 px = pix + Vector2(1,1);
SetTime( px, true );
- return m_center+m_position_f->evaluate( m_camera->Time().Et() );
+ return m_center+m_position_f->evaluate( m_camera->time().Et() );
}
Quat
IsisAdjustCameraModel::camera_pose( Vector2 const& pix ) const {
// Converting to ISIS index
Vector2 px = pix + Vector2(1,1);
SetTime( px, true );
- Vector3 angles = m_pose_f->evaluate( m_camera->Time().Et() );
+ Vector3 angles = m_pose_f->evaluate( m_camera->time().Et() );
return inverse(m_pose*math::axis_angle_to_quaternion( angles ) );
}
@@ -194,13 +194,13 @@ std::string IsisAdjustCameraModel::serial_number() const {
double IsisAdjustCameraModel::ephemeris_time( Vector2 const& pix ) const {
SetTime( pix+Vector2(1,1), false );
- return m_camera->Time().Et();
+ return m_camera->time().Et();
}
Vector3 IsisAdjustCameraModel::sun_position( Vector2 const& pix ) const {
SetTime( pix+Vector2(1,1), false );
Vector3 sun;
- m_camera->SunPosition( &sun[0] );
+ m_camera->sunPosition( &sun[0] );
sun *= 1000;
return sun;
}
@@ -216,10 +216,10 @@ IsisAdjustCameraModel::EphemerisLMA::result_type
IsisAdjustCameraModel::EphemerisLMA::operator()( IsisAdjustCameraModel::EphemerisLMA::domain_type const& x ) const {
// Setting Ephemeris Time
- m_camera->SetTime( Isis::iTime( x[0] ) );
+ m_camera->setTime( Isis::iTime( x[0] ) );
Vector3 instru;
- m_camera->InstrumentPosition(&instru[0]);
+ m_camera->instrumentPosition(&instru[0]);
instru *= 1000;
instru += m_position_f->evaluate( x[0] );
@@ -231,8 +231,8 @@ IsisAdjustCameraModel::EphemerisLMA::operator()( IsisAdjustCameraModel::Ephemeri
lookB_copy[0] = lookB[0];
lookB_copy[1] = lookB[1];
lookB_copy[2] = lookB[2];
- std::vector<double> lookJ = m_camera->BodyRotation()->J2000Vector(lookB_copy);
- std::vector<double> lookC = m_camera->InstrumentRotation()->ReferenceVector(lookJ);
+ std::vector<double> lookJ = m_camera->bodyRotation()->J2000Vector(lookB_copy);
+ std::vector<double> lookC = m_camera->instrumentRotation()->ReferenceVector(lookJ);
Vector3 look;
look[0] = lookC[0];
look[1] = lookC[1];
View
6 src/asp/IsisIO/IsisInterface.cc
@@ -84,19 +84,19 @@ std::string IsisInterface::serial_number() const {
double IsisInterface::ephemeris_time( vw::Vector2 const& pix ) const {
m_camera->SetImage( pix[0]+1, pix[1]+1 );
- return m_camera->Time().Et();
+ return m_camera->time().Et();
}
vw::Vector3 IsisInterface::sun_position( vw::Vector2 const& pix ) const {
m_camera->SetImage( pix[0]+1, pix[1]+1 );
Vector3 sun;
- m_camera->SunPosition( &sun[0] );
+ m_camera->sunPosition( &sun[0] );
return sun * 1000;
}
vw::Vector3 IsisInterface::target_radii() const {
Isis::Distance radii[3];
- m_camera->Radii(radii);
+ m_camera->radii(radii);
return Vector3( radii[0].meters(),
radii[1].meters(),
radii[2].meters() );
View
14 src/asp/IsisIO/IsisInterfaceFrame.cc
@@ -33,12 +33,12 @@ IsisInterfaceFrame::IsisInterfaceFrame( std::string const& filename ) :
m_detectmap = m_camera->DetectorMap();
// Calculating Center (just once)
- m_camera->InstrumentPosition(&m_center[0]);
+ m_camera->instrumentPosition(&m_center[0]);
m_center *= 1000;
// Calculating Pose (just once)
- std::vector<double> rot_inst = m_camera->InstrumentRotation()->Matrix();
- std::vector<double> rot_body = m_camera->BodyRotation()->Matrix();
+ std::vector<double> rot_inst = m_camera->instrumentRotation()->Matrix();
+ std::vector<double> rot_body = m_camera->bodyRotation()->Matrix();
MatrixProxy<double,3,3> R_inst(&(rot_inst[0]));
MatrixProxy<double,3,3> R_body(&(rot_body[0]));
@@ -53,8 +53,8 @@ IsisInterfaceFrame::point_to_pixel( Vector3 const& point ) const {
Vector3 look = normalize( point - m_center );
std::vector<double> lookB_copy(3);
std::copy( look.begin(), look.end(), lookB_copy.begin() );
- lookB_copy = m_camera->BodyRotation()->J2000Vector(lookB_copy);
- lookB_copy = m_camera->InstrumentRotation()->ReferenceVector(lookB_copy);
+ lookB_copy = m_camera->bodyRotation()->J2000Vector(lookB_copy);
+ lookB_copy = m_camera->instrumentRotation()->ReferenceVector(lookB_copy);
std::copy( lookB_copy.begin(), lookB_copy.end(), look.begin() );
look = m_camera->FocalLength() * ( look / look[2] );
@@ -82,8 +82,8 @@ IsisInterfaceFrame::pixel_to_vector( Vector2 const& px ) const {
look[2] = m_distortmap->UndistortedFocalPlaneZ();
VectorProxy<double,3> result( &look[0] );
result = normalize( result );
- look = m_camera->InstrumentRotation()->J2000Vector(look);
- look = m_camera->BodyRotation()->ReferenceVector(look);
+ look = m_camera->instrumentRotation()->J2000Vector(look);
+ look = m_camera->bodyRotation()->ReferenceVector(look);
return result;
}
View
24 src/asp/IsisIO/IsisInterfaceLineScan.cc
@@ -43,11 +43,11 @@ void IsisInterfaceLineScan::SetTime( Vector2 const& px, bool calc ) const {
if ( calc ) {
// Calculating Spacecraft position and pose
- m_camera->InstrumentPosition(&m_center[0]);
+ m_camera->instrumentPosition(&m_center[0]);
m_center *= 1000;
- std::vector<double> rot_inst = m_camera->InstrumentRotation()->Matrix();
- std::vector<double> rot_body = m_camera->BodyRotation()->Matrix();
+ std::vector<double> rot_inst = m_camera->instrumentRotation()->Matrix();
+ std::vector<double> rot_body = m_camera->bodyRotation()->Matrix();
MatrixProxy<double,3,3> R_inst(&(rot_inst[0]));
MatrixProxy<double,3,3> R_body(&(rot_body[0]));
m_pose = Quat(R_body*transpose(R_inst));
@@ -79,17 +79,17 @@ EphemerisLMA::result_type
EphemerisLMA::operator()( EphemerisLMA::domain_type const& x ) const {
// Setting Ephemeris Time
- m_camera->SetTime(Isis::iTime(x[0]));
+ m_camera->setTime(Isis::iTime(x[0]));
// Calculating the look direction in camera frame
Vector3 instru;
- m_camera->InstrumentPosition(&instru[0]);
+ m_camera->instrumentPosition(&instru[0]);
instru *= 1000; // Spice gives in km
Vector3 lookB = normalize( m_point - instru );
std::vector<double> lookB_copy(3);
std::copy( lookB.begin(), lookB.end(), lookB_copy.begin() );
- std::vector<double> lookJ = m_camera->BodyRotation()->J2000Vector(lookB_copy);
- std::vector<double> lookC = m_camera->InstrumentRotation()->ReferenceVector(lookJ);
+ std::vector<double> lookJ = m_camera->bodyRotation()->J2000Vector(lookB_copy);
+ std::vector<double> lookC = m_camera->instrumentRotation()->ReferenceVector(lookJ);
Vector3 look;
std::copy( lookC.begin(), lookC.end(), look.begin() );
@@ -111,7 +111,7 @@ IsisInterfaceLineScan::point_to_pixel( Vector3 const& point ) const {
// First seed LMA with an ephemeris time in the middle of the image
double middle = lines() / 2;
m_detectmap->SetParent( 1, m_alphacube.AlphaLine(middle) );
- double start_e = m_camera->Time().Et();
+ double start_e = m_camera->time().Et();
// Build LMA
EphemerisLMA model( point, m_camera.get(), m_distortmap, m_focalmap );
@@ -128,16 +128,16 @@ IsisInterfaceLineScan::point_to_pixel( Vector3 const& point ) const {
MathErr() << " Unable to project point into linescan camera " );
// Converting now to pixel
- m_camera->SetTime(Isis::iTime( solution_e[0] ));
+ m_camera->setTime(Isis::iTime( solution_e[0] ));
// Working out pointing
- m_camera->InstrumentPosition(&m_center[0]);
+ m_camera->instrumentPosition(&m_center[0]);
m_center *= 1000;
Vector3 look = normalize(point-m_center);
// Calculating Rotation to camera frame
- std::vector<double> rot_inst = m_camera->InstrumentRotation()->Matrix();
- std::vector<double> rot_body = m_camera->BodyRotation()->Matrix();
+ std::vector<double> rot_inst = m_camera->instrumentRotation()->Matrix();
+ std::vector<double> rot_body = m_camera->bodyRotation()->Matrix();
MatrixProxy<double,3,3> R_inst(&(rot_inst[0]));
MatrixProxy<double,3,3> R_body(&(rot_body[0]));
m_pose = Quat(R_body*transpose(R_inst));
View
8 src/asp/IsisIO/IsisInterfaceMapFrame.cc
@@ -41,15 +41,15 @@ IsisInterfaceMapFrame::IsisInterfaceMapFrame( std::string const& filename ) :
// Gutting Isis::Camera
m_groundmap = m_camera->GroundMap();
m_distortmap = m_camera->DistortionMap();
- m_camera->Radii( m_radii );
+ m_camera->radii( m_radii );
// Calculating Center (just once)
- m_camera->InstrumentPosition(&m_center[0]);
+ m_camera->instrumentPosition(&m_center[0]);
m_center *= 1000;
// Calculating Pose (just once)
- std::vector<double> rot_inst = m_camera->InstrumentRotation()->Matrix();
- std::vector<double> rot_body = m_camera->BodyRotation()->Matrix();
+ std::vector<double> rot_inst = m_camera->instrumentRotation()->Matrix();
+ std::vector<double> rot_body = m_camera->bodyRotation()->Matrix();
MatrixProxy<double,3,3> R_inst(&(rot_inst[0]));
MatrixProxy<double,3,3> R_body(&(rot_body[0]));
m_pose = Quat(R_body*transpose(R_inst));
View
24 src/asp/IsisIO/IsisInterfaceMapLineScan.cc
@@ -68,17 +68,17 @@ EphemerisLMA::result_type
EphemerisLMA::operator()( EphemerisLMA::domain_type const& x ) const {
// Setting Ephemeris Time
- m_camera->SetTime( Isis::iTime( x[0] ));
+ m_camera->setTime( Isis::iTime( x[0] ));
// Calculating the look direction in camera frame
Vector3 instru;
- m_camera->InstrumentPosition(&instru[0]);
+ m_camera->instrumentPosition(&instru[0]);
instru *= 1000; // Spice gives in km
Vector3 lookB = normalize( m_point - instru );
std::vector<double> lookB_copy(3);
std::copy(lookB.begin(),lookB.end(),lookB_copy.begin());
- std::vector<double> lookJ = m_camera->BodyRotation()->J2000Vector(lookB_copy);
- std::vector<double> lookC = m_camera->InstrumentRotation()->ReferenceVector(lookJ);
+ std::vector<double> lookJ = m_camera->bodyRotation()->J2000Vector(lookB_copy);
+ std::vector<double> lookC = m_camera->instrumentRotation()->ReferenceVector(lookJ);
Vector3 look;
std::copy(lookC.begin(),lookC.end(),look.begin());
@@ -99,7 +99,7 @@ IsisInterfaceMapLineScan::point_to_pixel( Vector3 const& point ) const {
// First seed LMA with an ephemeris time in the middle of the image
double middle_et =
- m_camera->CacheStartTime().Et() + (m_camera->CacheEndTime().Et()-m_camera->CacheStartTime().Et())/2.0;
+ m_camera->cacheStartTime().Et() + (m_camera->cacheEndTime().Et()-m_camera->cacheStartTime().Et())/2.0;
// Build LMA
EphemerisLMA model( point, m_camera.get(), m_distortmap, m_focalmap );
@@ -116,16 +116,16 @@ IsisInterfaceMapLineScan::point_to_pixel( Vector3 const& point ) const {
camera::PointToPixelErr() << " Unable to project point into linescan camera " );
// Setting to camera time to solution
- m_camera->SetTime( Isis::iTime( solution_e[0] ) );
+ m_camera->setTime( Isis::iTime( solution_e[0] ) );
// Working out pointing
Vector3 center;
- m_camera->InstrumentPosition(&center[0]);
+ m_camera->instrumentPosition(&center[0]);
Vector3 look = normalize(point-1000*center);
// Calculating Rotation to camera frame
- std::vector<double> rot_inst = m_camera->InstrumentRotation()->Matrix();
- std::vector<double> rot_body = m_camera->BodyRotation()->Matrix();
+ std::vector<double> rot_inst = m_camera->instrumentRotation()->Matrix();
+ std::vector<double> rot_body = m_camera->bodyRotation()->Matrix();
MatrixProxy<double,3,3> R_inst(&(rot_inst[0]));
MatrixProxy<double,3,3> R_body(&(rot_body[0]));
look = transpose(R_body*transpose(R_inst))*look;
@@ -155,7 +155,7 @@ IsisInterfaceMapLineScan::camera_center( Vector2 const& px ) const {
vw_throw( camera::PixelToRayErr() << "Failed to SetGround." );
}
Vector3 position;
- m_camera->InstrumentPosition( &position[0] );
+ m_camera->instrumentPosition( &position[0] );
return position * 1e3;
}
@@ -170,8 +170,8 @@ IsisInterfaceMapLineScan::pixel_to_vector( Vector2 const& px ) const {
Quat
IsisInterfaceMapLineScan::camera_pose( Vector2 const& px ) const {
camera_center( px );
- std::vector<double> rot_inst = m_camera->InstrumentRotation()->Matrix();
- std::vector<double> rot_body = m_camera->BodyRotation()->Matrix();
+ std::vector<double> rot_inst = m_camera->instrumentRotation()->Matrix();
+ std::vector<double> rot_body = m_camera->bodyRotation()->Matrix();
MatrixProxy<double,3,3> R_inst(&(rot_inst[0]));
MatrixProxy<double,3,3> R_body(&(rot_body[0]));
return Quat(R_body*transpose(R_inst));
View
8 src/asp/IsisIO/tests/TestIsisCameraModel.cxx
@@ -90,7 +90,7 @@ TEST(IsisCameraModel, mapprojected) {
lon_lat_radius[2] );
EXPECT_VECTOR_NEAR( Vector2(cam->Sample(),cam->Line()), pixel, 1e-3 );
double ip[3];
- cam->InstrumentPosition( ip );
+ cam->instrumentPosition( ip );
VectorProxy<double,3> instru( ip );
double bc[3];
cam->Coordinate( bc );
@@ -169,8 +169,8 @@ TEST(IsisCameraModel, groundmap_chk) {
nog_solution /= norm_2(nog_solution);
std::vector<double> lookC(3); // Should make fancy func for std vec and vec
std::copy( nog_solution.begin(), nog_solution.end(), lookC.begin() );
- std::vector<double> lookJ = cam->InstrumentRotation()->J2000Vector(lookC);
- lookC = cam->BodyRotation()->ReferenceVector(lookJ);
+ std::vector<double> lookJ = cam->instrumentRotation()->J2000Vector(lookC);
+ lookC = cam->bodyRotation()->ReferenceVector(lookJ);
std::copy( lookC.begin(), lookC.end(), nog_solution.begin() );
nog_solution_sets.push_back(nog_solution);
@@ -187,7 +187,7 @@ TEST(IsisCameraModel, groundmap_chk) {
// Ground Map Solution
cam->SetImage(pixel[0],pixel[1]);
double p[3];
- cam->InstrumentPosition(p);
+ cam->instrumentPosition(p);
Vector3 instrument( p[0], p[1], p[2] );
cam->Coordinate(p);

0 comments on commit 5ae437b

Please sign in to comment.