Skip to content

Commit

Permalink
Update Kaguya TC camera model time and add option to Spice::getClockT…
Browse files Browse the repository at this point in the history
…ime (DOI-USGS#3237)

* Added gtests for Displacement.cpp, removed Displacement unitTest and truthfile. (DOI-USGS#3209)

* Added BasisFunctionTests.cpp. Removed BasisFunction unit test and truthfile.

* changed expectedOutput values for some of the tests

* Made tests for Displacement.cpp using gtest. removed Displacement unitTest and truthfile.

* Initial distortion model changes

* Updated README data area instructions (DOI-USGS#3214)

* Fixed data area instructions in README and some links

* Fixed bold in block quote

* Fixed legacy install guide link

* extra l

* Testing indentation list

* Testing indentation list again

* Testing indentation list code snippet

* Minor wording clean up

* Removed extra number

* Removed duplicate Mars Odyssey entry

* Distortion model updates to actually match equation in documentation

* Update truthdata for sensor model

* Updates to the build recipe for ISIS releases for the 3.7.0 release candidate. (DOI-USGS#3205)

* Minor modifications for RC build

* Small modification to version in the recipe/meta.yaml

* Updating release stage in isis/version

* Switch Kaguya TC to use L/S camera detector map. It is not a framer!

* Fix typo

* Update detector origin in Kaguya TC model to be more reasonable

* Update to center position and offsets for distortion map swath modes added to Kaguya TC Camera Model

* Added Area3DTests.cpp (DOI-USGS#3216)

* Added BasisFunctionTests.cpp. Removed BasisFunction unit test and truthfile.

* changed expectedOutput values for some of the tests

* Made tests for Displacement.cpp using gtest. removed Displacement unitTest and truthfile.

* Added Area3DTests.cpp, removed Area3D truthfile and unit test.

* included TestUtilities.h for use with exception testing, added a test for teh Area3D '=' operator

* changed formatting to adhere to USGS coding standards

* re-addedd the unit test and truth file

* gllssi2isis Original Label Fix (DOI-USGS#3226)

* Allowed writting of residuals when value is zero to controlnet pvl

* Updated ControlNetVersioner unit test

* Fixed pvl labels original pvl labels not being written to the resulting cube.

* Updated docstrings and history for updated methods

* Removed the need to set the output cube pixel type

* Reverted proceeimport changes

* Set the dimensions in the process before processing

* Added missing 1 in a history record

* Reverted and applied a more appropriate fix

* Used outfile obtained at the beginning of the program

* Added history comment to app xml

* Removed accidental comma (DOI-USGS#3230)

* Update README.md (DOI-USGS#3232)

Update readability

* Updated the time used by the camera model to use the clock count, rather than the start time

* Modifying files for conda build for ISIS3.7.0_RC2 (DOI-USGS#3229)

* Modifying files for conda build for ISIS3.7.0_RC_2

* Changes to modifications until issue DOI-USGS#3231 can be completed

* Small typo

* One final added comment for clarification
  • Loading branch information
krlberry committed Apr 25, 2019
1 parent e6bbd81 commit a1671c9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
14 changes: 11 additions & 3 deletions isis/src/base/objs/Spice/Spice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -967,11 +967,14 @@ namespace Isis {

/**
* This converts the spacecraft clock ticks value (clockValue) to an iTime.
*
*
* If the clock ticks value is provided directly, rather than the spacecraft
* clock string, set clockTicks=true.
*
* Use this when possible because naif calls (such as scs2e_c) cannot be
* called when not using naif.
*/
iTime Spice::getClockTime(QString clockValue, int sclkCode) {
iTime Spice::getClockTime(QString clockValue, int sclkCode, bool clockTicks) {
if (sclkCode == -1) {
sclkCode = naifSclkCode();
}
Expand All @@ -984,7 +987,12 @@ namespace Isis {
if (storedClockTime.isNull()) {
SpiceDouble timeOutput;
NaifStatus::CheckErrors();
scs2e_c(sclkCode, clockValue.toLatin1().data(), &timeOutput);
if (clockTicks) {
sct2e_c(sclkCode, (SpiceDouble) clockValue.toDouble(), &timeOutput);
}
else {
scs2e_c(sclkCode, clockValue.toLatin1().data(), &timeOutput);
}
NaifStatus::CheckErrors();
storedClockTime = timeOutput;
storeResult(key, SpiceDoubleType, timeOutput);
Expand Down
8 changes: 7 additions & 1 deletion isis/src/base/objs/Spice/Spice.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,11 @@ namespace Isis {
* PCK to define the new body, including its body code. This PCK is only
* loaded in spiceinit so the code needs to be saved so that the radii
* keyword can be created to retrieve the target radii.
* @history 2019-04-16 Kristin Berry - Added a parameter to getClockTime called clockTicks which
* defaults to false. When set to true, this indicates that the input value
* is in encoded clock ticks, rather than a full spacecraft clock time
* string. As such, when used sct2e_c is used to convert to an ET rather
* than scs2e_c.
*/
class Spice {
public:
Expand Down Expand Up @@ -320,7 +325,8 @@ namespace Isis {
QString targetName() const;

iTime getClockTime(QString clockValue,
int sclkCode = -1);
int sclkCode = -1,
bool clockTicks=false);
SpiceDouble getDouble(const QString &key, int index = 0);
SpiceInt getInteger(const QString &key, int index = 0);
QString getString(const QString &key, int index = 0);
Expand Down
8 changes: 4 additions & 4 deletions isis/src/kaguya/objs/KaguyaTcCamera/KaguyaTcCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,11 @@ namespace Isis {
Pvl &lab = *cube.label();
PvlGroup inst = lab.findGroup("Instrument", Pvl::Traverse);

// StartTime is used, rather than SpacecraftClockStartCount because the format of
// SpaceCraftClockStart count is incompatible with getClockTime
double time = iTime((QString)inst["StartTime"]).Et();
QString clockCount = inst["SpacecraftClockStartCount"];
double time = getClockTime(clockCount, -1, true).Et();

// Setup detector map
double lineRate = (double) inst["LineSamplingInterval"] / 1000.0; // ALE uses the ExposureDuration
double lineRate = (double) inst["LineSamplingInterval"] / 1000.0;

// Convert between parent image coordinates and detector coordinates (detector coordinate line, detector coordinate sample)
LineScanCameraDetectorMap *detectorMap = new LineScanCameraDetectorMap(this, time, lineRate);
Expand All @@ -86,6 +85,7 @@ namespace Isis {
CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());

// This is the same, no matter the swath mode

// This set the origin of the detector (not image samp,line). It is zero bassed.
// The detector offsets are 0,0 because the borsight is in the center of the array
QString key;
Expand Down

0 comments on commit a1671c9

Please sign in to comment.