Skip to content

Commit

Permalink
Moves partial calculation into CSM and ISIS observation classes. (DOI…
Browse files Browse the repository at this point in the history
…-USGS#4436)

* Remove duplicated member variables and accesor functions from BundleObservation and add Csm camera type to Camera enum

* Remove commented-out code

* Imagecoeff migrated into BundleObservation class working

* Get base level working for all coeffs in ISIS

* Fix accidental move into if statement to get tests passing again

* Updated RHS for CsmBundleObservation to work

* Adds point3D support to CSM Camera observations and also adds ground Partials member function to CSMCamera

* Draft of sensor partials code

* Add docs, some fixes based on review requests

* move computation of weights and observation values to bundle observations

* Add observationvalue function to CsmBundleObservation and move the weighting that it is possible to to the observation classes

* Make CSMSolveSet an optional parameter to get jigsaw tests passing again

* cleanup

* Move observation weights into MLE if block

Co-authored-by: Kristin Berry <[email protected]>
  • Loading branch information
2 people authored and tgiroux committed Jun 8, 2021
1 parent 5ce4355 commit 29cceca
Show file tree
Hide file tree
Showing 9 changed files with 594 additions and 233 deletions.
58 changes: 57 additions & 1 deletion isis/src/base/objs/CSMCamera/CSMCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ namespace Isis {
throw IException(IException::User, msg, _FILEINFO_);
}
if (!plugin->canModelBeConstructedFromState(modelName.toStdString(), stateString.toStdString())) {
QString msg = "CSM state string attached to image [" + cube.fileName() + "]. cannot "
QString msg = "CSM state string attached to image [" + cube.fileName() + "] cannot "
"be converted to a [" + modelName + "] using [" + pluginName + "].";
throw IException(IException::Programmer, msg, _FILEINFO_);
}
Expand Down Expand Up @@ -599,6 +599,52 @@ namespace Isis {
}


/**
* Compute the partial derivatives of the sample, line with
* respect to the x, y, z coordinates of the ground point.
*
* The resultant partials are
* line WRT x
* line WRT y
* line WRT z
* sample WRT x
* sample WRT y
* sample WRT z
*
* @return @b std::vector<double> The partial derivatives of the
* sample, line with respect to
* the ground coordinate.
*/
vector<double> CSMCamera::GroundPartials() {
return GroundPartials(GetSurfacePoint());
}


/**
* Compute the partial derivatives of the sample, line with
* respect to the x, y, z coordinates of the ground point.
*
* The resultant partials are
* line WRT x
* line WRT y
* line WRT z
* sample WRT x
* sample WRT y
* sample WRT z
*
* @param groundPoint The ground point to compute the partials at
*
* @return @b std::vector<double> The partial derivatives of the
* sample, line with respect to
* the ground coordinate.
*/
vector<double> CSMCamera::GroundPartials(SurfacePoint groundPoint) {
csm::EcefCoord groundCoord = isisToCsmGround(groundPoint);
vector<double> groundPartials = m_model->computeGroundPartials(groundCoord);
return groundPartials;
}


/**
* Set the Target object for the camera model.
*
Expand Down Expand Up @@ -848,6 +894,16 @@ namespace Isis {
return m_model->getParameterCovariance(index1, index2);
}


vector<double> CSMCamera::getSensorPartials(int index, SurfacePoint groundPoint) {
// csm::SensorPartials holds (line, sample) in order for each parameter
csm::EcefCoord groundCoord = isisToCsmGround(groundPoint);
std::pair<double, double> partials = m_model->computeSensorPartials(index, groundCoord);
vector<double> partialsVector = {partials.first, partials.second};

return partialsVector;
}


/**
* Set the time and update the sensor position and orientation.
Expand Down
5 changes: 4 additions & 1 deletion isis/src/base/objs/CSMCamera/CSMCamera.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ namespace Isis {
std::vector<int> getParameterIndices(QStringList paramList) const;
void applyParameterCorrection(int index, double correction);
double getParameterCovariance(int index1, int index2);
std::vector<double> getSensorPartials(int index, SurfacePoint groundPoint);

virtual std::vector<double> GroundPartials(SurfacePoint groundPoint);
virtual std::vector<double> GroundPartials();

protected:
void setTarget(Pvl label);
Expand All @@ -144,7 +148,6 @@ namespace Isis {

virtual std::vector<double> ImagePartials(SurfacePoint groundPoint);
virtual std::vector<double> ImagePartials();

};
};
#endif
1 change: 1 addition & 0 deletions isis/src/control/apps/jigsaw/jigsaw.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,7 @@

<group name="Community Sensor Model Options">
<parameter name="CSMSOLVESET">
<internalDefault>none</internalDefault>
<type>string</type>
<brief>Specify a set of a CSM parameters to solve for.</brief>
<description>
Expand Down
Loading

0 comments on commit 29cceca

Please sign in to comment.