From 4ac2d46edee928f086337db2347789dbda51cd9f Mon Sep 17 00:00:00 2001 From: Kristin Date: Wed, 15 May 2019 17:35:18 -0700 Subject: [PATCH] updates for review comments (#3277) * Updated truthdata for ProcessExportPds4 class to match updates made for CaSSIS sprint * Fix trailing Z time-format in tgocassis2isis when reingesting images exported from ISIS3 * Added base for KaguyaTcCamera * Still adding to base * additonal changes * Added appropriate ckframeid * Fixed improper makefile * Added unitTest.cpp to KaguyaTcCamera * Adding camera plugin and test. * Update camera plugin. * Added working unit test. Added naif ck ID to ingestion. * Changed camera parent class to LineScanCamera * Add a Distortion Model to Kaguya TC ISIS camera model (#3215) * Initial distortion model changes * Distortion model updates to actually match equation in documentation * Update truthdata for sensor model * Update Kaguya TC Camera model to use LineScan Camera detector map (#3218) * Initial distortion model changes * Distortion model updates to actually match equation in documentation * Update truthdata for sensor model * Switch Kaguya TC to use L/S camera detector map. It is not a framer! * Fix typo * Fixes GroundMap, SkyMap in Kaguya TC Camera Model and improve Focal Map Origin (#3220) * Initial distortion model changes * Distortion model updates to actually match equation in documentation * Update truthdata for sensor model * 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 Kaguya TC Camera Model to include Detector offsets for swath modes (#3222) * Initial distortion model changes * Distortion model updates to actually match equation in documentation * Update truthdata for sensor model * 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 * Change camera model to pull the Origin from the IAK * Update Kaguya TC camera model time and add option to Spice::getClockTime (#3237) * Added gtests for Displacement.cpp, removed Displacement unitTest and truthfile. (#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 (#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. (#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 (#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 (#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 (#3230) * Update README.md (#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 (#3229) * Modifying files for conda build for ISIS3.7.0_RC_2 * Changes to modifications until issue #3231 can be completed * Small typo * One final added comment for clarification * Update unit test for Kaguya TC to match output of updated camera model * Updates to Kaguya TC big PR based on comments --- .../apps/kaguyatc2isis/kaguyatc2isis.xml | 2 +- isis/src/kaguya/apps/kaguyatc2isis/main.cpp | 6 +++- .../objs/KaguyaTcCamera/KaguyaTcCamera.cpp | 7 ++-- .../objs/KaguyaTcCamera/KaguyaTcCamera.h | 15 +++++++- .../KaguyaTcCameraDistortionMap.cpp | 35 ++++++++++--------- 5 files changed, 40 insertions(+), 25 deletions(-) diff --git a/isis/src/kaguya/apps/kaguyatc2isis/kaguyatc2isis.xml b/isis/src/kaguya/apps/kaguyatc2isis/kaguyatc2isis.xml index 447b229333..978d2ee9b1 100644 --- a/isis/src/kaguya/apps/kaguyatc2isis/kaguyatc2isis.xml +++ b/isis/src/kaguya/apps/kaguyatc2isis/kaguyatc2isis.xml @@ -54,7 +54,7 @@ Use this parameter to select the Kaguya Terrain - Camera filename. This file must contain the PDS + Camera filename. This file must contain the PDS labels. diff --git a/isis/src/kaguya/apps/kaguyatc2isis/main.cpp b/isis/src/kaguya/apps/kaguyatc2isis/main.cpp index 243f411d72..86e995041b 100644 --- a/isis/src/kaguya/apps/kaguyatc2isis/main.cpp +++ b/isis/src/kaguya/apps/kaguyatc2isis/main.cpp @@ -127,7 +127,11 @@ void IsisMain() { } } outcube->putGroup(otherLabels.findGroup("Instrument")); -/* +/* + // This code is not needed now, but is included here commented-out in case it becomes necessary + // to support the swath modes by setting their NaifFrameCodes in the future. The swath mode + // setting is currently handled entirely via the camera model. + // add kernels group QString instId = inst["InstrumentId"]; QString encoding = inst["EncodingType"]; diff --git a/isis/src/kaguya/objs/KaguyaTcCamera/KaguyaTcCamera.cpp b/isis/src/kaguya/objs/KaguyaTcCamera/KaguyaTcCamera.cpp index 52f06167ba..8a3828fc8f 100644 --- a/isis/src/kaguya/objs/KaguyaTcCamera/KaguyaTcCamera.cpp +++ b/isis/src/kaguya/objs/KaguyaTcCamera/KaguyaTcCamera.cpp @@ -23,7 +23,6 @@ #include #include "LineScanCameraDetectorMap.h" -#include "CameraDistortionMap.h" #include "CameraFocalPlaneMap.h" #include "LineScanCameraGroundMap.h" #include "LineScanCameraSkyMap.h" @@ -84,10 +83,9 @@ 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. + // This sets 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 + // The origin of the detector does not depend on swath mode. QString key; key = "INS" + toString(naifIkCode()) + "_BORESIGHT_SAMPLE"; double sampleBoreSight = getDouble(key); @@ -98,7 +96,6 @@ namespace Isis { // Setup distortion map new KaguyaTcCameraDistortionMap(this, naifIkCode()); -// new CameraDistortionMap(this); // Setup the ground and sky map new LineScanCameraGroundMap(this); diff --git a/isis/src/kaguya/objs/KaguyaTcCamera/KaguyaTcCamera.h b/isis/src/kaguya/objs/KaguyaTcCamera/KaguyaTcCamera.h index 686f0ab561..40e68e88c9 100644 --- a/isis/src/kaguya/objs/KaguyaTcCamera/KaguyaTcCamera.h +++ b/isis/src/kaguya/objs/KaguyaTcCamera/KaguyaTcCamera.h @@ -23,7 +23,20 @@ #include "LineScanCamera.h" namespace Isis { - + /** + * This is the camera model for the Kaguya Terrain Cameras TC1 and TC2 + * + * @internal + * @history 2018-10-01 Adam Goins and Jeannie Backer - Original Version + * + * @history 2019-04-26 Stuart Sides and Kristin Berry - Updates to Kaguya TC camera model + * including updating to use LineScanCamera detector and ground maps, adding + * detector offsets for swath modes, setting the focal plane map center to + * the center of the detector, regardless of swath mode, and using the + * spacecraft clock start count, rather than the StartTime for image timing. + * See Git issue #3215 for more information. + * + */ class KaguyaTcCamera : public LineScanCamera { public: KaguyaTcCamera(Cube &cube); diff --git a/isis/src/kaguya/objs/KaguyaTcCamera/KaguyaTcCameraDistortionMap.cpp b/isis/src/kaguya/objs/KaguyaTcCamera/KaguyaTcCameraDistortionMap.cpp index 96ff7ae99d..cca06f61d0 100644 --- a/isis/src/kaguya/objs/KaguyaTcCamera/KaguyaTcCameraDistortionMap.cpp +++ b/isis/src/kaguya/objs/KaguyaTcCamera/KaguyaTcCameraDistortionMap.cpp @@ -90,26 +90,27 @@ namespace Isis { double r = qSqrt(r2); double r3 = r2 * r; - // Apply distortion correction + + + // This function implements the following distortion correction from the IK for the terrain camera, // see: SEL_TC_V01.TI + // // r2 = x^2 + y^2 - // Line-of-sight vector of pixel no. n can be expressed as below. - - // Distortion coefficients information: - // INS_DISTORTION_COEF_X = ( a0, a1, a2, a3) - // INS_DISTORTION_COEF_Y = ( b0, b1, b2, b3), - // - // Distance r from the center: - // r = - (n - INS_CENTER) * INS_PIXEL_SIZE. - // - // Line-of-sight vector v is calculated as - // v[X] = INSBORESIGHT[X] - // +a0 +a1*r +a2*r^2 +a3*r^3 , - // v[Y] = INSBORESIGHT[Y] - // +r +a0 +a1*r +a2*r^2 +a3*r^3 , - // v[Z] = INSBORESIGHT[Z] . - + // Distortion coefficients information: + // INS_DISTORTION_COEF_X = ( a0, a1, a2, a3) + // INS_DISTORTION_COEF_Y = ( b0, b1, b2, b3), + // + // Distance r from the center: + // r = - (n - INS_CENTER) * INS_PIXEL_SIZE. + // + // Line-of-sight vector v is calculated as + // v[X] = INSBORESIGHT[X] + // +a0 +a1*r +a2*r^2 +a3*r^3 , + // v[Y] = INSBORESIGHT[Y] + // +r +a0 +a1*r +a2*r^2 +a3*r^3 , + // v[Z] = INSBORESIGHT[Z] . + // Apply distortion correction double dr_x = p_odkx[0] + p_odkx[1] * r + p_odkx[2] * r2 + p_odkx[3] * r3; double dr_y = p_odky[0] + p_odky[1] * r + p_odky[2] * r2 + p_odky[3] * r3;