Skip to content

Commit

Permalink
Csmcsv (DOI-USGS#4446)
Browse files Browse the repository at this point in the history
* CSM CSV output

* Small test clean-up

* typo fix

* obs header fix

* Remove param list from bo

* Added debug output

* Now reurning

* Fixed unit test

* xml save test update

* Clean up bundleresults unit test output

* Fixed qfile member

* Fixed old path

* Changed header to use param names

* Making separate csvs

* Added reverse on obs by instId

* Trying to fix multiple sensors

* Fixed images header

* More debug

* removed debug outs

* Added terrible imageindex search

* Added held config fix

* Updated for observation test

* Updated jigsaw test makefiles

* Updated with new tests
  • Loading branch information
jessemapel authored and tgiroux committed Jun 8, 2021
1 parent 3262491 commit 7c24e42
Show file tree
Hide file tree
Showing 19 changed files with 710 additions and 542 deletions.
10 changes: 5 additions & 5 deletions isis/src/base/objs/CSMCamera/CSMCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ namespace Isis {
* sample WRT y
* sample WRT z
*
* @return @b std::vector<double> The partial derivatives of the
* @return @b std::vector<double> The partial derivatives of the
* sample, line with respect to
* the ground coordinate.
*/
Expand All @@ -634,7 +634,7 @@ namespace Isis {
*
* @param groundPoint The ground point to compute the partials at
*
* @return @b std::vector<double> The partial derivatives of the
* @return @b std::vector<double> The partial derivatives of the
* sample, line with respect to
* the ground coordinate.
*/
Expand Down Expand Up @@ -864,7 +864,7 @@ namespace Isis {
for (int i = 0; i < paramList.size(); i++) {
for (int j = 0; j < m_model->getNumParameters(); j++) {
if (m_model->getParameterName(j) == paramList[i].toStdString()) {
parameterIndices.push_back(i);
parameterIndices.push_back(j);
}
}
}
Expand Down Expand Up @@ -894,14 +894,14 @@ 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;
return partialsVector;
}


Expand Down
10 changes: 8 additions & 2 deletions isis/src/control/apps/jigsaw/tsts/scconfig/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@ commands:
bundleout_txt=no \
output_csv=no \
residuals_csv=no > /dev/null;
$(CAT) bundleout_images.csv \
$(CAT) bundleout_images_MARS_ODYSSEY_THEMIS_IR.csv \
| perl -pe 's/(^|,|: )([^,:]+\/)([^,\/:]*\.)(net|cub)/\1\3\4/g' 2> /dev/null \
> $(OUTPUT)/bundleout_scconfig_images.csv;
> $(OUTPUT)/bundleout_scconfig_images_themis.csv;
$(CAT) bundleout_images_VIKING_ORBITER_1_VISUAL_IMAGING_SUBSYSTEM_CAMERA_B.csv \
| perl -pe 's/(^|,|: )([^,:]+\/)([^,\/:]*\.)(net|cub)/\1\3\4/g' 2> /dev/null \
> $(OUTPUT)/bundleout_scconfig_images_viking_1.csv;
$(CAT) bundleout_images_VIKING_ORBITER_2_VISUAL_IMAGING_SUBSYSTEM_CAMERA_A.csv \
| perl -pe 's/(^|,|: )([^,:]+\/)([^,\/:]*\.)(net|cub)/\1\3\4/g' 2> /dev/null \
> $(OUTPUT)/bundleout_scconfig_images_viking_2.csv;
$(RM) $(OUTPUT)/cubes.lis > /dev/null;
$(RM) $(OUTPUT)/*.net > /dev/null;
$(RM) *.csv > /dev/null;
15 changes: 12 additions & 3 deletions isis/src/control/apps/jigsaw/tsts/scconfigHeld/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,18 @@ commands:
bundleout_txt=no \
output_csv=no \
residuals_csv=no > /dev/null;
$(CAT) bundleout_images.csv \
| perl -pe 's/(^|,|: )([^,:]+\/)([^,\/:]*\.)(net|cub)/\1\3\4/g' 2> /dev/null \
> $(OUTPUT)/bundleout_scconfig_images.csv;
$(CAT) bundleout_images_MARS_ODYSSEY_THEMIS_IR.csv \
| perl -pe 's/(^|,|: )([^,:]+\/)([^,\/:]*\.)(net|cub)/\1\3\4/g' 2> /dev/null \
> $(OUTPUT)/bundleout_scconfig_images_themis.csv;
$(CAT) bundleout_images_VIKING_ORBITER_1_VISUAL_IMAGING_SUBSYSTEM_CAMERA_B.csv \
| perl -pe 's/(^|,|: )([^,:]+\/)([^,\/:]*\.)(net|cub)/\1\3\4/g' 2> /dev/null \
> $(OUTPUT)/bundleout_scconfig_images_viking_1.csv;
$(CAT) bundleout_images_VIKING_ORBITER_2_VISUAL_IMAGING_SUBSYSTEM_CAMERA_A.csv \
| perl -pe 's/(^|,|: )([^,:]+\/)([^,\/:]*\.)(net|cub)/\1\3\4/g' 2> /dev/null \
> $(OUTPUT)/bundleout_scconfig_images_viking_2.csv;
$(CAT) bundleout_images_held.csv \
| perl -pe 's/(^|,|: )([^,:]+\/)([^,\/:]*\.)(net|cub)/\1\3\4/g' 2> /dev/null \
> $(OUTPUT)/bundleout_scconfig_images_held.csv;
$(RM) $(OUTPUT)/cubes.lis > /dev/null;
$(RM) $(OUTPUT)/hold.lis > /dev/null;
$(RM) $(OUTPUT)/*.net > /dev/null;
Expand Down
16 changes: 10 additions & 6 deletions isis/src/control/objs/BundleResults/unitTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,19 @@ namespace Isis {
BundleResultsXmlHandlerTester(Project *project, XmlStackedHandlerReader *reader,
FileName xmlFile) : BundleResults(project, reader) {

QString xmlPath(xmlFile.expanded());
QFile file(xmlPath);
m_file.setFileName(xmlFile.expanded());

if (!file.open(QFile::ReadOnly) ) {
if (!m_file.open(QFile::ReadOnly) ) {
throw IException(IException::Io,
QString("Unable to open xml file, [%1], with read access").arg(xmlPath),
QString("Unable to open xml file, [%1], with read access").arg(xmlFile.expanded()),
_FILEINFO_);
}

QXmlInputSource xmlInputSource(&file);
QXmlInputSource xmlInputSource(&m_file);
bool success = reader->parse(xmlInputSource);
if (!success) {
throw IException(IException::Unknown,
QString("Failed to parse xml file, [%1]").arg(xmlPath),
QString("Failed to parse xml file, [%1]").arg(m_file.fileName()),
_FILEINFO_);
}

Expand All @@ -81,8 +80,13 @@ namespace Isis {
* Destroys the tester object
*/
~BundleResultsXmlHandlerTester() {
if (m_file.exists()) {
m_file.remove();
}
}

QFile m_file;

};
}

Expand Down
Loading

0 comments on commit 7c24e42

Please # to comment.