Skip to content
This repository
Browse code

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...
commit 5ae437becf2243c72ca386a8d09f50837ea10c4d 1 parent dd6c207
Zack Moratto zmoratto authored
40 src/asp/IsisIO/IsisAdjustCameraModel.cc
@@ -56,7 +56,7 @@ IsisAdjustCameraModel::IsisAdjustCameraModel( std::string cube_filename,
56 56 vw_throw( NoImplErr() << "Don't support map projected images" );
57 57
58 58 // Adjusting time offset so equations are reference from middle of cache
59   - double middle_et = m_camera->CacheStartTime().Et() + (m_camera->CacheEndTime().Et()-m_camera->CacheStartTime().Et())/2.0;
  59 + double middle_et = m_camera->cacheStartTime().Et() + (m_camera->cacheEndTime().Et()-m_camera->cacheStartTime().Et())/2.0;
60 60 m_position_f->set_time_offset( middle_et );
61 61 m_pose_f->set_time_offset( middle_et );
62 62 }
@@ -74,11 +74,11 @@ void IsisAdjustCameraModel::SetTime( Vector2 const& px,
74 74
75 75 if ( calc ) {
76 76 // Calculating Spacecraft position and pose
77   - m_camera->InstrumentPosition(&m_center[0]);
  77 + m_camera->instrumentPosition(&m_center[0]);
78 78 m_center *= 1000;
79 79
80   - std::vector<double> rot_inst = m_camera->InstrumentRotation()->Matrix();
81   - std::vector<double> rot_body = m_camera->BodyRotation()->Matrix();
  80 + std::vector<double> rot_inst = m_camera->instrumentRotation()->Matrix();
  81 + std::vector<double> rot_body = m_camera->bodyRotation()->Matrix();
82 82 MatrixProxy<double,3,3> R_inst(&(rot_inst[0]));
83 83 MatrixProxy<double,3,3> R_body(&(rot_body[0]));
84 84 m_pose = Quat( R_inst*transpose(R_body) );
@@ -96,7 +96,7 @@ Vector2 IsisAdjustCameraModel::point_to_pixel( Vector3 const& point ) const {
96 96 if ( m_camera->GetCameraType() == 2 ) {
97 97 // Use own LMA to find correct ephemeris time. This also gives the
98 98 // ability to use own functions for ET.
99   - double start_e = m_camera->CacheStartTime().Et() + (m_camera->CacheEndTime().Et()-m_camera->CacheStartTime().Et())/2.0;
  99 + double start_e = m_camera->cacheStartTime().Et() + (m_camera->cacheEndTime().Et()-m_camera->cacheStartTime().Et())/2.0;
100 100
101 101 // Build LMA
102 102 EphemerisLMA model( point, m_camera, m_distortmap,
@@ -114,26 +114,26 @@ Vector2 IsisAdjustCameraModel::point_to_pixel( Vector3 const& point ) const {
114 114 MathErr() << " Unable to project point into linescan camera " );
115 115
116 116 // Converting now to pixel
117   - m_camera->SetTime( Isis::iTime( solution_e[0] ) );
  117 + m_camera->setTime( Isis::iTime( solution_e[0] ) );
118 118 } else if ( m_camera->GetCameraType() != 0 ) {
119 119 vw_throw( NoImplErr() << "IsisAdjustCameraModel::point_to_pixel does not support any cmaeras other than LineScane and Frame" );
120 120 }
121 121
122 122 // Pulling out camera position for current time
123   - m_camera->InstrumentPosition(&m_center[0]);
  123 + m_camera->instrumentPosition(&m_center[0]);
124 124 m_center *= 1000;
125 125
126 126 // Pulling out camera pose
127   - std::vector<double> rot_inst = m_camera->InstrumentRotation()->Matrix();
128   - std::vector<double> rot_body = m_camera->BodyRotation()->Matrix();
  127 + std::vector<double> rot_inst = m_camera->instrumentRotation()->Matrix();
  128 + std::vector<double> rot_body = m_camera->bodyRotation()->Matrix();
129 129 MatrixProxy<double,3,3> R_inst(&(rot_inst[0]));
130 130 MatrixProxy<double,3,3> R_body(&(rot_body[0]));
131 131 m_pose = Quat(R_inst*transpose(R_body));
132   - Vector3 angles = m_pose_f->evaluate( m_camera->Time().Et() );
  132 + Vector3 angles = m_pose_f->evaluate( m_camera->time().Et() );
133 133 Quat pose_adj( m_pose*math::axis_angle_to_quaternion( angles ) );
134 134
135 135 // Actually projecting point now
136   - Vector3 look = normalize( point - (m_center+m_position_f->evaluate(m_camera->Time().Et())) );
  136 + Vector3 look = normalize( point - (m_center+m_position_f->evaluate(m_camera->time().Et())) );
137 137 look = pose_adj.rotate( look );
138 138 look = m_camera->FocalLength() * ( look / look[2] );
139 139 m_distortmap->SetUndistortedFocalPlane( look[0], look[1] );
@@ -165,7 +165,7 @@ Vector3 IsisAdjustCameraModel::pixel_to_vector( Vector2 const& pix ) const {
165 165 result = normalize( result );
166 166
167 167 // Apply rotation of image camera
168   - Vector3 angles = m_pose_f->evaluate( m_camera->Time().Et() );
  168 + Vector3 angles = m_pose_f->evaluate( m_camera->time().Et() );
169 169 result = inverse( m_pose*math::axis_angle_to_quaternion(angles) ).rotate( result );
170 170 return result;
171 171 }
@@ -175,7 +175,7 @@ IsisAdjustCameraModel::camera_center( Vector2 const& pix ) const {
175 175 // Converting to ISIS index
176 176 Vector2 px = pix + Vector2(1,1);
177 177 SetTime( px, true );
178   - return m_center+m_position_f->evaluate( m_camera->Time().Et() );
  178 + return m_center+m_position_f->evaluate( m_camera->time().Et() );
179 179 }
180 180
181 181 Quat
@@ -183,7 +183,7 @@ IsisAdjustCameraModel::camera_pose( Vector2 const& pix ) const {
183 183 // Converting to ISIS index
184 184 Vector2 px = pix + Vector2(1,1);
185 185 SetTime( px, true );
186   - Vector3 angles = m_pose_f->evaluate( m_camera->Time().Et() );
  186 + Vector3 angles = m_pose_f->evaluate( m_camera->time().Et() );
187 187 return inverse(m_pose*math::axis_angle_to_quaternion( angles ) );
188 188 }
189 189
@@ -194,13 +194,13 @@ std::string IsisAdjustCameraModel::serial_number() const {
194 194
195 195 double IsisAdjustCameraModel::ephemeris_time( Vector2 const& pix ) const {
196 196 SetTime( pix+Vector2(1,1), false );
197   - return m_camera->Time().Et();
  197 + return m_camera->time().Et();
198 198 }
199 199
200 200 Vector3 IsisAdjustCameraModel::sun_position( Vector2 const& pix ) const {
201 201 SetTime( pix+Vector2(1,1), false );
202 202 Vector3 sun;
203   - m_camera->SunPosition( &sun[0] );
  203 + m_camera->sunPosition( &sun[0] );
204 204 sun *= 1000;
205 205 return sun;
206 206 }
@@ -216,10 +216,10 @@ IsisAdjustCameraModel::EphemerisLMA::result_type
216 216 IsisAdjustCameraModel::EphemerisLMA::operator()( IsisAdjustCameraModel::EphemerisLMA::domain_type const& x ) const {
217 217
218 218 // Setting Ephemeris Time
219   - m_camera->SetTime( Isis::iTime( x[0] ) );
  219 + m_camera->setTime( Isis::iTime( x[0] ) );
220 220
221 221 Vector3 instru;
222   - m_camera->InstrumentPosition(&instru[0]);
  222 + m_camera->instrumentPosition(&instru[0]);
223 223 instru *= 1000;
224 224 instru += m_position_f->evaluate( x[0] );
225 225
@@ -231,8 +231,8 @@ IsisAdjustCameraModel::EphemerisLMA::operator()( IsisAdjustCameraModel::Ephemeri
231 231 lookB_copy[0] = lookB[0];
232 232 lookB_copy[1] = lookB[1];
233 233 lookB_copy[2] = lookB[2];
234   - std::vector<double> lookJ = m_camera->BodyRotation()->J2000Vector(lookB_copy);
235   - std::vector<double> lookC = m_camera->InstrumentRotation()->ReferenceVector(lookJ);
  234 + std::vector<double> lookJ = m_camera->bodyRotation()->J2000Vector(lookB_copy);
  235 + std::vector<double> lookC = m_camera->instrumentRotation()->ReferenceVector(lookJ);
236 236 Vector3 look;
237 237 look[0] = lookC[0];
238 238 look[1] = lookC[1];
6 src/asp/IsisIO/IsisInterface.cc
@@ -84,19 +84,19 @@ std::string IsisInterface::serial_number() const {
84 84
85 85 double IsisInterface::ephemeris_time( vw::Vector2 const& pix ) const {
86 86 m_camera->SetImage( pix[0]+1, pix[1]+1 );
87   - return m_camera->Time().Et();
  87 + return m_camera->time().Et();
88 88 }
89 89
90 90 vw::Vector3 IsisInterface::sun_position( vw::Vector2 const& pix ) const {
91 91 m_camera->SetImage( pix[0]+1, pix[1]+1 );
92 92 Vector3 sun;
93   - m_camera->SunPosition( &sun[0] );
  93 + m_camera->sunPosition( &sun[0] );
94 94 return sun * 1000;
95 95 }
96 96
97 97 vw::Vector3 IsisInterface::target_radii() const {
98 98 Isis::Distance radii[3];
99   - m_camera->Radii(radii);
  99 + m_camera->radii(radii);
100 100 return Vector3( radii[0].meters(),
101 101 radii[1].meters(),
102 102 radii[2].meters() );
14 src/asp/IsisIO/IsisInterfaceFrame.cc
@@ -33,12 +33,12 @@ IsisInterfaceFrame::IsisInterfaceFrame( std::string const& filename ) :
33 33 m_detectmap = m_camera->DetectorMap();
34 34
35 35 // Calculating Center (just once)
36   - m_camera->InstrumentPosition(&m_center[0]);
  36 + m_camera->instrumentPosition(&m_center[0]);
37 37 m_center *= 1000;
38 38
39 39 // Calculating Pose (just once)
40   - std::vector<double> rot_inst = m_camera->InstrumentRotation()->Matrix();
41   - std::vector<double> rot_body = m_camera->BodyRotation()->Matrix();
  40 + std::vector<double> rot_inst = m_camera->instrumentRotation()->Matrix();
  41 + std::vector<double> rot_body = m_camera->bodyRotation()->Matrix();
42 42 MatrixProxy<double,3,3> R_inst(&(rot_inst[0]));
43 43 MatrixProxy<double,3,3> R_body(&(rot_body[0]));
44 44
@@ -53,8 +53,8 @@ IsisInterfaceFrame::point_to_pixel( Vector3 const& point ) const {
53 53 Vector3 look = normalize( point - m_center );
54 54 std::vector<double> lookB_copy(3);
55 55 std::copy( look.begin(), look.end(), lookB_copy.begin() );
56   - lookB_copy = m_camera->BodyRotation()->J2000Vector(lookB_copy);
57   - lookB_copy = m_camera->InstrumentRotation()->ReferenceVector(lookB_copy);
  56 + lookB_copy = m_camera->bodyRotation()->J2000Vector(lookB_copy);
  57 + lookB_copy = m_camera->instrumentRotation()->ReferenceVector(lookB_copy);
58 58 std::copy( lookB_copy.begin(), lookB_copy.end(), look.begin() );
59 59 look = m_camera->FocalLength() * ( look / look[2] );
60 60
@@ -82,8 +82,8 @@ IsisInterfaceFrame::pixel_to_vector( Vector2 const& px ) const {
82 82 look[2] = m_distortmap->UndistortedFocalPlaneZ();
83 83 VectorProxy<double,3> result( &look[0] );
84 84 result = normalize( result );
85   - look = m_camera->InstrumentRotation()->J2000Vector(look);
86   - look = m_camera->BodyRotation()->ReferenceVector(look);
  85 + look = m_camera->instrumentRotation()->J2000Vector(look);
  86 + look = m_camera->bodyRotation()->ReferenceVector(look);
87 87 return result;
88 88 }
89 89
24 src/asp/IsisIO/IsisInterfaceLineScan.cc
@@ -43,11 +43,11 @@ void IsisInterfaceLineScan::SetTime( Vector2 const& px, bool calc ) const {
43 43
44 44 if ( calc ) {
45 45 // Calculating Spacecraft position and pose
46   - m_camera->InstrumentPosition(&m_center[0]);
  46 + m_camera->instrumentPosition(&m_center[0]);
47 47 m_center *= 1000;
48 48
49   - std::vector<double> rot_inst = m_camera->InstrumentRotation()->Matrix();
50   - std::vector<double> rot_body = m_camera->BodyRotation()->Matrix();
  49 + std::vector<double> rot_inst = m_camera->instrumentRotation()->Matrix();
  50 + std::vector<double> rot_body = m_camera->bodyRotation()->Matrix();
51 51 MatrixProxy<double,3,3> R_inst(&(rot_inst[0]));
52 52 MatrixProxy<double,3,3> R_body(&(rot_body[0]));
53 53 m_pose = Quat(R_body*transpose(R_inst));
@@ -79,17 +79,17 @@ EphemerisLMA::result_type
79 79 EphemerisLMA::operator()( EphemerisLMA::domain_type const& x ) const {
80 80
81 81 // Setting Ephemeris Time
82   - m_camera->SetTime(Isis::iTime(x[0]));
  82 + m_camera->setTime(Isis::iTime(x[0]));
83 83
84 84 // Calculating the look direction in camera frame
85 85 Vector3 instru;
86   - m_camera->InstrumentPosition(&instru[0]);
  86 + m_camera->instrumentPosition(&instru[0]);
87 87 instru *= 1000; // Spice gives in km
88 88 Vector3 lookB = normalize( m_point - instru );
89 89 std::vector<double> lookB_copy(3);
90 90 std::copy( lookB.begin(), lookB.end(), lookB_copy.begin() );
91   - std::vector<double> lookJ = m_camera->BodyRotation()->J2000Vector(lookB_copy);
92   - std::vector<double> lookC = m_camera->InstrumentRotation()->ReferenceVector(lookJ);
  91 + std::vector<double> lookJ = m_camera->bodyRotation()->J2000Vector(lookB_copy);
  92 + std::vector<double> lookC = m_camera->instrumentRotation()->ReferenceVector(lookJ);
93 93 Vector3 look;
94 94 std::copy( lookC.begin(), lookC.end(), look.begin() );
95 95
@@ -111,7 +111,7 @@ IsisInterfaceLineScan::point_to_pixel( Vector3 const& point ) const {
111 111 // First seed LMA with an ephemeris time in the middle of the image
112 112 double middle = lines() / 2;
113 113 m_detectmap->SetParent( 1, m_alphacube.AlphaLine(middle) );
114   - double start_e = m_camera->Time().Et();
  114 + double start_e = m_camera->time().Et();
115 115
116 116 // Build LMA
117 117 EphemerisLMA model( point, m_camera.get(), m_distortmap, m_focalmap );
@@ -128,16 +128,16 @@ IsisInterfaceLineScan::point_to_pixel( Vector3 const& point ) const {
128 128 MathErr() << " Unable to project point into linescan camera " );
129 129
130 130 // Converting now to pixel
131   - m_camera->SetTime(Isis::iTime( solution_e[0] ));
  131 + m_camera->setTime(Isis::iTime( solution_e[0] ));
132 132
133 133 // Working out pointing
134   - m_camera->InstrumentPosition(&m_center[0]);
  134 + m_camera->instrumentPosition(&m_center[0]);
135 135 m_center *= 1000;
136 136 Vector3 look = normalize(point-m_center);
137 137
138 138 // Calculating Rotation to camera frame
139   - std::vector<double> rot_inst = m_camera->InstrumentRotation()->Matrix();
140   - std::vector<double> rot_body = m_camera->BodyRotation()->Matrix();
  139 + std::vector<double> rot_inst = m_camera->instrumentRotation()->Matrix();
  140 + std::vector<double> rot_body = m_camera->bodyRotation()->Matrix();
141 141 MatrixProxy<double,3,3> R_inst(&(rot_inst[0]));
142 142 MatrixProxy<double,3,3> R_body(&(rot_body[0]));
143 143 m_pose = Quat(R_body*transpose(R_inst));
8 src/asp/IsisIO/IsisInterfaceMapFrame.cc
@@ -41,15 +41,15 @@ IsisInterfaceMapFrame::IsisInterfaceMapFrame( std::string const& filename ) :
41 41 // Gutting Isis::Camera
42 42 m_groundmap = m_camera->GroundMap();
43 43 m_distortmap = m_camera->DistortionMap();
44   - m_camera->Radii( m_radii );
  44 + m_camera->radii( m_radii );
45 45
46 46 // Calculating Center (just once)
47   - m_camera->InstrumentPosition(&m_center[0]);
  47 + m_camera->instrumentPosition(&m_center[0]);
48 48 m_center *= 1000;
49 49
50 50 // Calculating Pose (just once)
51   - std::vector<double> rot_inst = m_camera->InstrumentRotation()->Matrix();
52   - std::vector<double> rot_body = m_camera->BodyRotation()->Matrix();
  51 + std::vector<double> rot_inst = m_camera->instrumentRotation()->Matrix();
  52 + std::vector<double> rot_body = m_camera->bodyRotation()->Matrix();
53 53 MatrixProxy<double,3,3> R_inst(&(rot_inst[0]));
54 54 MatrixProxy<double,3,3> R_body(&(rot_body[0]));
55 55 m_pose = Quat(R_body*transpose(R_inst));
24 src/asp/IsisIO/IsisInterfaceMapLineScan.cc
@@ -68,17 +68,17 @@ EphemerisLMA::result_type
68 68 EphemerisLMA::operator()( EphemerisLMA::domain_type const& x ) const {
69 69
70 70 // Setting Ephemeris Time
71   - m_camera->SetTime( Isis::iTime( x[0] ));
  71 + m_camera->setTime( Isis::iTime( x[0] ));
72 72
73 73 // Calculating the look direction in camera frame
74 74 Vector3 instru;
75   - m_camera->InstrumentPosition(&instru[0]);
  75 + m_camera->instrumentPosition(&instru[0]);
76 76 instru *= 1000; // Spice gives in km
77 77 Vector3 lookB = normalize( m_point - instru );
78 78 std::vector<double> lookB_copy(3);
79 79 std::copy(lookB.begin(),lookB.end(),lookB_copy.begin());
80   - std::vector<double> lookJ = m_camera->BodyRotation()->J2000Vector(lookB_copy);
81   - std::vector<double> lookC = m_camera->InstrumentRotation()->ReferenceVector(lookJ);
  80 + std::vector<double> lookJ = m_camera->bodyRotation()->J2000Vector(lookB_copy);
  81 + std::vector<double> lookC = m_camera->instrumentRotation()->ReferenceVector(lookJ);
82 82 Vector3 look;
83 83 std::copy(lookC.begin(),lookC.end(),look.begin());
84 84
@@ -99,7 +99,7 @@ IsisInterfaceMapLineScan::point_to_pixel( Vector3 const& point ) const {
99 99
100 100 // First seed LMA with an ephemeris time in the middle of the image
101 101 double middle_et =
102   - m_camera->CacheStartTime().Et() + (m_camera->CacheEndTime().Et()-m_camera->CacheStartTime().Et())/2.0;
  102 + m_camera->cacheStartTime().Et() + (m_camera->cacheEndTime().Et()-m_camera->cacheStartTime().Et())/2.0;
103 103
104 104 // Build LMA
105 105 EphemerisLMA model( point, m_camera.get(), m_distortmap, m_focalmap );
@@ -116,16 +116,16 @@ IsisInterfaceMapLineScan::point_to_pixel( Vector3 const& point ) const {
116 116 camera::PointToPixelErr() << " Unable to project point into linescan camera " );
117 117
118 118 // Setting to camera time to solution
119   - m_camera->SetTime( Isis::iTime( solution_e[0] ) );
  119 + m_camera->setTime( Isis::iTime( solution_e[0] ) );
120 120
121 121 // Working out pointing
122 122 Vector3 center;
123   - m_camera->InstrumentPosition(&center[0]);
  123 + m_camera->instrumentPosition(&center[0]);
124 124 Vector3 look = normalize(point-1000*center);
125 125
126 126 // Calculating Rotation to camera frame
127   - std::vector<double> rot_inst = m_camera->InstrumentRotation()->Matrix();
128   - std::vector<double> rot_body = m_camera->BodyRotation()->Matrix();
  127 + std::vector<double> rot_inst = m_camera->instrumentRotation()->Matrix();
  128 + std::vector<double> rot_body = m_camera->bodyRotation()->Matrix();
129 129 MatrixProxy<double,3,3> R_inst(&(rot_inst[0]));
130 130 MatrixProxy<double,3,3> R_body(&(rot_body[0]));
131 131 look = transpose(R_body*transpose(R_inst))*look;
@@ -155,7 +155,7 @@ IsisInterfaceMapLineScan::camera_center( Vector2 const& px ) const {
155 155 vw_throw( camera::PixelToRayErr() << "Failed to SetGround." );
156 156 }
157 157 Vector3 position;
158   - m_camera->InstrumentPosition( &position[0] );
  158 + m_camera->instrumentPosition( &position[0] );
159 159 return position * 1e3;
160 160 }
161 161
@@ -170,8 +170,8 @@ IsisInterfaceMapLineScan::pixel_to_vector( Vector2 const& px ) const {
170 170 Quat
171 171 IsisInterfaceMapLineScan::camera_pose( Vector2 const& px ) const {
172 172 camera_center( px );
173   - std::vector<double> rot_inst = m_camera->InstrumentRotation()->Matrix();
174   - std::vector<double> rot_body = m_camera->BodyRotation()->Matrix();
  173 + std::vector<double> rot_inst = m_camera->instrumentRotation()->Matrix();
  174 + std::vector<double> rot_body = m_camera->bodyRotation()->Matrix();
175 175 MatrixProxy<double,3,3> R_inst(&(rot_inst[0]));
176 176 MatrixProxy<double,3,3> R_body(&(rot_body[0]));
177 177 return Quat(R_body*transpose(R_inst));
8 src/asp/IsisIO/tests/TestIsisCameraModel.cxx
@@ -90,7 +90,7 @@ TEST(IsisCameraModel, mapprojected) {
90 90 lon_lat_radius[2] );
91 91 EXPECT_VECTOR_NEAR( Vector2(cam->Sample(),cam->Line()), pixel, 1e-3 );
92 92 double ip[3];
93   - cam->InstrumentPosition( ip );
  93 + cam->instrumentPosition( ip );
94 94 VectorProxy<double,3> instru( ip );
95 95 double bc[3];
96 96 cam->Coordinate( bc );
@@ -169,8 +169,8 @@ TEST(IsisCameraModel, groundmap_chk) {
169 169 nog_solution /= norm_2(nog_solution);
170 170 std::vector<double> lookC(3); // Should make fancy func for std vec and vec
171 171 std::copy( nog_solution.begin(), nog_solution.end(), lookC.begin() );
172   - std::vector<double> lookJ = cam->InstrumentRotation()->J2000Vector(lookC);
173   - lookC = cam->BodyRotation()->ReferenceVector(lookJ);
  172 + std::vector<double> lookJ = cam->instrumentRotation()->J2000Vector(lookC);
  173 + lookC = cam->bodyRotation()->ReferenceVector(lookJ);
174 174 std::copy( lookC.begin(), lookC.end(), nog_solution.begin() );
175 175
176 176 nog_solution_sets.push_back(nog_solution);
@@ -187,7 +187,7 @@ TEST(IsisCameraModel, groundmap_chk) {
187 187 // Ground Map Solution
188 188 cam->SetImage(pixel[0],pixel[1]);
189 189 double p[3];
190   - cam->InstrumentPosition(p);
  190 + cam->instrumentPosition(p);
191 191 Vector3 instrument( p[0], p[1], p[2] );
192 192
193 193 cam->Coordinate(p);

0 comments on commit 5ae437b

Please sign in to comment.
Something went wrong with that request. Please try again.