Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spice rotation update to use ALE #3977

Merged
merged 16 commits into from
Aug 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 35 additions & 5 deletions isis/src/base/apps/appjit/LineScanCameraRotation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include <cmath>
#include <iomanip>

#include<ale/Rotation.h>

#include "Cube.h"
#include "LineScanCameraRotation.h"
#include "Quaternion.h"
Expand Down Expand Up @@ -121,6 +123,7 @@ namespace Isis {
SpiceRotation *prot = p_spi->bodyRotation();
SpiceRotation *crot = p_spi->instrumentRotation();

std::vector<ale::Rotation> rotationCache;
for(std::vector<double>::iterator i = p_cacheTime.begin(); i < p_cacheTime.end(); i++) {
double et = *i;

Expand Down Expand Up @@ -155,8 +158,23 @@ namespace Isis {

// Put CI into parent cache to use the parent class methods on it
mxmt_c((SpiceDouble( *)[3]) &CI[0], (SpiceDouble( *)[3]) &IB[0], (SpiceDouble( *)[3]) &CI[0]);
p_cache.push_back(CI);
rotationCache.push_back(ale::Rotation(CI));
}

if (m_orientation) {
delete m_orientation;
m_orientation = NULL;
}

if (ConstantRotation().size() > 1) {
m_orientation = new ale::Orientations(rotationCache, p_cacheTime, std::vector<ale::Vec3d>(),
ale::Rotation(ConstantMatrix()), ConstantFrameChain(), TimeFrameChain());
}
else {
m_orientation = new ale::Orientations(rotationCache, p_cacheTime, std::vector<ale::Vec3d>(),
ale::Rotation(1,0,0,0), ConstantFrameChain(), TimeFrameChain());
}

p_cachesLoaded = true;
SetSource(Memcache);

Expand Down Expand Up @@ -185,9 +203,6 @@ namespace Isis {
throw IException(IException::Programmer, msg, _FILEINFO_);
}

// Clear existing matrices from cache
p_cache.clear();

// Create polynomials fit to angles & use to reload cache
Isis::PolynomialUnivariate function1(p_degree);
Isis::PolynomialUnivariate function2(p_degree);
Expand Down Expand Up @@ -218,6 +233,7 @@ namespace Isis {
std::vector<double> CJ;
CJ.resize(9);

std::vector<ale::Rotation> rotationCache;
for(std::vector<double>::size_type pos = 0; pos < p_cacheTime.size(); pos++) {
double et = p_cacheTime.at(pos);
rtime = (et - GetBaseTime()) / GetTimeScale();
Expand All @@ -242,7 +258,21 @@ namespace Isis {
mxm_c((SpiceDouble( *)[3]) & (p_cacheIB.at(pos))[0], (SpiceDouble( *)[3]) & (prot->Matrix())[0], IJ);
mxm_c(CI, IJ, (SpiceDouble( *)[3]) &CJ[0]);

p_cache.push_back(CJ); // J2000 to constant frame
rotationCache.push_back(ale::Rotation(CJ));
}

if (m_orientation) {
delete m_orientation;
m_orientation = NULL;
}

if (ConstantRotation().size() > 1) {
m_orientation = new ale::Orientations(rotationCache, p_cacheTime, std::vector<ale::Vec3d>(),
ale::Rotation(ConstantMatrix()), ConstantFrameChain(), TimeFrameChain());
}
else {
m_orientation = new ale::Orientations(rotationCache, p_cacheTime, std::vector<ale::Vec3d>(),
ale::Rotation(1,0,0,0), ConstantFrameChain(), TimeFrameChain());
}

// Set source to cache to get updated values
Expand Down
2 changes: 0 additions & 2 deletions isis/src/base/apps/appjit/LineScanCameraRotation.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,9 @@ namespace Isis {
class LineScanCameraRotation : public Isis::SpiceRotation {
public:
//! Constructors
// LineScanCameraRotation( int frameCode, SpiceRotation *crot, SpiceRotation *prot, SpicePosition *spos );
LineScanCameraRotation(int frameCode, Isis::Cube &cube, std::vector<double> timeCache, double tol);

//! Destructor
// virtual ~LineScanCameraRotation() { };
virtual ~LineScanCameraRotation();

void LoadCache();
Expand Down
12 changes: 6 additions & 6 deletions isis/src/base/objs/CameraPointInfo/CameraPointInfo.truth
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Group = GroundPoint
Declination = 67.288137235407 <DEGREE>
PlanetocentricLatitude = -85.539935681585 <DEGREE>
PlanetographicLatitude = -85.539935681585 <DEGREE>
PositiveEast360Longitude = 27.089555271673 <DEGREE>
PositiveEast180Longitude = 27.089555271673 <DEGREE>
PositiveEast360Longitude = 27.089555271672 <DEGREE>
PositiveEast180Longitude = 27.089555271672 <DEGREE>
PositiveWest360Longitude = 332.91044472833 <DEGREE>
PositiveWest180Longitude = -27.089555271672 <DEGREE>
BodyFixedCoordinate = (120.6493939079, 61.711663528734,
Expand All @@ -21,13 +21,13 @@ Group = GroundPoint
ObliqueSampleResolution = 187.44583818806 <meters>

# Spacecraft Information
SpacecraftPosition = (216.77599432924, 54.260221515166,
SpacecraftPosition = (216.77599432924, 54.260221515165,
-2462.1104393388) <km>
SpacecraftAzimuth = 38.331 <DEGREE>
SlantDistance = 731.11938668312 <km>
TargetCenterDistance = 2472.2305351357 <km>
SubSpacecraftLatitude = -84.813985589411 <DEGREE>
SubSpacecraftLongitude = 14.052715974499 <DEGREE>
SubSpacecraftLongitude = 14.052715974498 <DEGREE>
SpacecraftAltitude = 735.29826910549 <km>
OffNadirAngle = 3.124 <DEGREE>
SubSpacecraftGroundAzimuth = 296.906 <DEGREE>
Expand Down Expand Up @@ -84,13 +84,13 @@ Group = GroundPoint
ObliqueSampleResolution = 187.61662252249 <meters>

# Spacecraft Information
SpacecraftPosition = (216.77599432924, 54.260221515166,
SpacecraftPosition = (216.77599432924, 54.260221515165,
-2462.1104393388) <km>
SpacecraftAzimuth = 284.604 <DEGREE>
SlantDistance = 733.84767049682 <km>
TargetCenterDistance = 2472.2305351357 <km>
SubSpacecraftLatitude = -84.813985589411 <DEGREE>
SubSpacecraftLongitude = 14.052715974499 <DEGREE>
SubSpacecraftLongitude = 14.052715974498 <DEGREE>
SpacecraftAltitude = 735.29826910549 <km>
OffNadirAngle = 0.773 <DEGREE>
SubSpacecraftGroundAzimuth = 195.221 <DEGREE>
Expand Down
Loading