-
Notifications
You must be signed in to change notification settings - Fork 175
Add support for Chandrayaan2TMC #5767
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
Open
acpaquette
wants to merge
7
commits into
DOI-USGS:dev
Choose a base branch
from
acpaquette:chandrayaan2
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
dd213b9
Initial Chandrayaan2TmcCamera
1262855
Chandrayaan2tmc updates and fixes
25cced0
Updated arrays to vectors to prevent over allocating stack for large …
5d7ca0d
Added custom rotation for chandrayaan2
acpaquette 3911748
Quoted elements in the chandrayaan2 isisimport template
acpaquette 40c97dd
Added chandrayaan2 datadir translation
acpaquette d41d163
Reverted chandrayaan1 M3 unittest
acpaquette File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include $(ISISROOT)/make/isismake.cat | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this used for anything other than cat tests? |
6 changes: 6 additions & 0 deletions
6
isis/src/chandrayaan2/objs/Chandrayaan2TmcCamera/Camera.plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Group = CHANDRAYAAN-2/TMC-2 | ||
Version = 1 | ||
Library = Chandrayaan2TmcCamera | ||
Routine = Chandrayaan2TmcCameraPlugin | ||
EndGroup | ||
|
119 changes: 119 additions & 0 deletions
119
isis/src/chandrayaan2/objs/Chandrayaan2TmcCamera/Chandrayaan2TmcCamera.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
/** This is free and unencumbered software released into the public domain. | ||
|
||
The authors of ISIS do not claim copyright on the contents of this file. | ||
For more details about the LICENSE terms and the AUTHORS, you will | ||
find files of those names at the top level of this repository. **/ | ||
|
||
/* SPDX-License-Identifier: CC0-1.0 */ | ||
|
||
#include "Chandrayaan2TmcCamera.h" | ||
|
||
#include <QString> | ||
|
||
#include "Affine.h" | ||
#include "CameraDistortionMap.h" | ||
#include "CameraFocalPlaneMap.h" | ||
#include "IException.h" | ||
#include "iTime.h" | ||
#include "IString.h" | ||
#include "LineScanCameraDetectorMap.h" | ||
#include "LineScanCameraGroundMap.h" | ||
#include "LineScanCameraSkyMap.h" | ||
#include "NaifStatus.h" | ||
|
||
using namespace std; | ||
namespace Isis { | ||
/** | ||
* Constructs a Chandrayaan 2 TMC Camera object using the image labels. | ||
* | ||
*/ | ||
Chandrayaan2TmcCamera::Chandrayaan2TmcCamera(Cube &cube) : LineScanCamera(cube) { | ||
m_instrumentNameLong = "Terrain Mapping Camera-2"; | ||
m_instrumentNameShort = "TMC-2"; | ||
m_spacecraftNameLong = "Chandrayaan 2"; | ||
m_spacecraftNameShort = "Chan2"; | ||
|
||
NaifStatus::CheckErrors(); | ||
// Set up the camera info from ik/iak kernels | ||
SetFocalLength(); | ||
//Chandrayaan2 iak uses INS-152???_PIXEL_SIZE instead of PIXEL_PITCH | ||
QString ikernKey = "INS" + toString(naifIkCode()) + "_PIXEL_SIZE"; | ||
// Pixel size is specified in meters, we need it in mm | ||
SetPixelPitch(getDouble(ikernKey)*1000); | ||
|
||
// Get the start time from labels | ||
Pvl &lab = *cube.label(); | ||
PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse); | ||
QString stime = (QString)inst["StartTime"]; | ||
SpiceDouble etStart=0; | ||
etStart = iTime(stime).Et(); | ||
|
||
double csum = 1; | ||
if (inst.hasKeyword("SpatialSumming")){ | ||
csum = inst["SpatialSumming"]; | ||
} | ||
double lineRate = (double) inst["LineExposureDuration"] / 1000; | ||
|
||
// Setup detector map | ||
LineScanCameraDetectorMap *detectorMap = | ||
new LineScanCameraDetectorMap(this, etStart, lineRate); | ||
detectorMap->SetDetectorSampleSumming(csum); | ||
|
||
// Setup focal plane map | ||
CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode()); | ||
|
||
// Retrieve boresight location from instrument kernel (IK) (addendum?) | ||
QString centerKey = "INS" + toString((int)naifIkCode()) + "_CENTER"; | ||
double sampleCenter = getDouble(centerKey, 0); | ||
double lineCenter = getDouble(centerKey, 1); | ||
|
||
focalMap->SetDetectorOrigin(sampleCenter, lineCenter); | ||
focalMap->SetDetectorOffset(0.0, 0.0); | ||
|
||
// @TODO set no distortion? No values in IK | ||
// Setup distortion map | ||
CameraDistortionMap *distMap = new CameraDistortionMap(this); | ||
distMap->SetDistortion(naifIkCode()); | ||
|
||
// Setup the ground and sky map | ||
new LineScanCameraGroundMap(this); | ||
new LineScanCameraSkyMap(this); | ||
|
||
|
||
// Set proper end frame | ||
int tmcFrame(0); | ||
if (naifIkCode() == -152210) { | ||
// Frame DAWN_VIR_VIS : DAWN_VIR_VIS_ZERO | ||
tmcFrame = -152220; | ||
} | ||
else if (naifIkCode() == -152211) { // (channelId == "IR) | ||
// Frame DAWN_VIR_IR : DAWN_VIR_IR_ZERO | ||
tmcFrame = -152221; | ||
} | ||
else if (naifIkCode() == -152212) { | ||
tmcFrame = -152222; | ||
} | ||
else { | ||
QString msg = "Unknown frame code [" + toString(naifIkCode()) + "] for Chandrayaan2 TMC Camera."; | ||
throw IException(IException::Programmer, msg, _FILEINFO_); | ||
} | ||
|
||
instrumentRotation()->SetFrame(tmcFrame); | ||
|
||
LoadCache(); | ||
NaifStatus::CheckErrors(); | ||
} | ||
} | ||
|
||
|
||
/** | ||
* This is the function that is called in order to instantiate an Chandrayaan2TmcCamera object. | ||
* | ||
* @param cube The input cube from which to instantiate the camera model. | ||
* | ||
* @return Isis::Camera* Chandrayaan2TmcCamera | ||
* | ||
*/ | ||
extern "C" Isis::Camera *Chandrayaan2TmcCameraPlugin(Isis::Cube &cube) { | ||
return new Isis::Chandrayaan2TmcCamera(cube); | ||
} |
52 changes: 52 additions & 0 deletions
52
isis/src/chandrayaan2/objs/Chandrayaan2TmcCamera/Chandrayaan2TmcCamera.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#ifndef TMCCamera_h | ||
#define TMCCamera_h | ||
|
||
/** This is free and unencumbered software released into the public domain. | ||
|
||
The authors of ISIS do not claim copyright on the contents of this file. | ||
For more details about the LICENSE terms and the AUTHORS, you will | ||
find files of those names at the top level of this repository. **/ | ||
|
||
/* SPDX-License-Identifier: CC0-1.0 */ | ||
|
||
#include "LineScanCamera.h" | ||
|
||
namespace Isis { | ||
/** | ||
* @brief Chandrayaan2 TMC (Terrain Mapping Camera) Camera Model | ||
* | ||
* This is the camera model for the Chandrayaan2 Terrain Mapping Camera | ||
*/ | ||
class Chandrayaan2TmcCamera : public LineScanCamera { | ||
public: | ||
Chandrayaan2TmcCamera(Cube &cube); | ||
|
||
//! Destroys the CTXCamera object. | ||
~Chandrayaan2TmcCamera() {}; | ||
|
||
/** | ||
* CK frame ID - - Instrument Code from spacit run on CK | ||
* | ||
* @return @b int The appropriate instrument code for the "Camera-matrix" | ||
* Kernel Frame ID | ||
*/ | ||
virtual int CkFrameId() const { return (-152001); } | ||
|
||
/** | ||
* CK Reference ID - MRO_MME_OF_DATE | ||
* | ||
* @return @b int The appropriate instrument code for the "Camera-matrix" | ||
* Kernel Reference ID | ||
*/ | ||
virtual int CkReferenceId() const { return (1); } | ||
|
||
/** | ||
* SPK Reference ID - J2000 | ||
* | ||
* @return @b int The appropriate instrument code for the Spacecraft | ||
* Kernel Reference ID | ||
*/ | ||
virtual int SpkReferenceId() const { return (1); } | ||
}; | ||
}; | ||
#endif |
36 changes: 36 additions & 0 deletions
36
isis/src/chandrayaan2/objs/Chandrayaan2TmcCamera/Chandrayaan2TmcCamera.truth
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
Unit Test for Chandrayaan1M3Camera... | ||
FileName: out.cub | ||
CK Frame: -152210 | ||
|
||
Kernel IDs: | ||
CK Frame ID = -152001 | ||
CK Reference ID = 1 | ||
SPK Target ID = -152 | ||
SPK Reference ID = 1 | ||
|
||
Spacecraft Name Long: Chandrayaan 2 | ||
Spacecraft Name Short: Chan2 | ||
Instrument Name Long: Terrain Mapping Camera-2 | ||
Instrument Name Short: TMC-2 | ||
|
||
For upper left corner ... | ||
DeltaSample = 0.000000000 | ||
DeltaLine = 0.000000000 | ||
|
||
For upper right corner ... | ||
DeltaSample = 0.000000000 | ||
DeltaLine = 0.000000000 | ||
|
||
For lower left corner ... | ||
DeltaSample = 0.000000000 | ||
DeltaLine = 0.000000000 | ||
|
||
For lower right corner ... | ||
DeltaSample = 0.000000000 | ||
DeltaLine = 0.000000000 | ||
|
||
For center pixel position ... | ||
Latitude OK | ||
Longitude OK | ||
RightAscension = 120.8153761895855354 | ||
Declination = -23.1624991236805506 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
ifeq ($(ISISROOT), $(BLANK)) | ||
.SILENT: | ||
error: | ||
echo "Please set ISISROOT"; | ||
else | ||
include $(ISISROOT)/make/isismake.objs | ||
endif |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why multiply the index?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the old code quats was a 2d array, here we changed it to a 1d vector so we have to jump over four elements each time to read the quaternion. I think this largely had to do with 2d vectors not being contiguious