Skip to content
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

***DO NOT MERGE*** Adds SCCONFIG parameter to jigsaw #3612

Closed
wants to merge 12 commits into from

Conversation

paarongiroux
Copy link
Contributor

@paarongiroux paarongiroux commented Dec 18, 2019

Description

Added SSCONFIG parameter to jigsaw.xml. This allows users to pass in a pvl file to set different parameters for different instruments. Added logic into jigsaw's main.cpp in order to facilitate the use of this new parameter.
Added a new BundleObservationSolveSettings constructor to build a BundleObservationSolveSettings given a pvl group.
Currently causing some existing tests to fail, and needs new tests to cover the changes we've implemented.

Related Issue

#3369

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation change (update to the documentation; no code change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have read and agree to abide by the Code of Conduct
  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Licensing

This project is mostly composed of free and unencumbered software released into the public domain, and we are unlikely to accept contributions that are not also released into the public domain. Somewhere near the top of each file should have these words:

This work is free and unencumbered software released into the public domain. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain.

  • I dedicate any and all copyright interest in this software to the public domain. I make this dedication for the benefit of the public at large and to the detriment of my heirs and successors. I intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

<item>OVEREXISTING</item>
<item>SPKDEGREE</item>
<item>SPKSOLVEDEGREE</item>
<item>SPSOLVE</item>
<!-- <item>TWIST</item> -->
Copy link
Contributor Author

@paarongiroux paarongiroux Dec 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason, having this leads to the following error message when running jigsaw:
**USER ERROR** Parameter [TWIST] must be used if parameter [SCCONFIG] is used.

CAMERA_ANGULAR_VELOCITY_SIGMA, CAMERA_ANGULAR_ACCELERATION_SIGMA. An example
template is located at $base/templates/jigsaw/SC_Parameters.pvl.
</description>
<parameter name="SCCONFIG">
<exclusions>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently, I've only added parameters that the BOSS constructor populates into the exclusion list.
I'm sure there are other parameters that should be excluded, but I have a hard time figuring out which ones.

m_numberCamAngleCoefSolved = m_ckSolveDegree + 1;
}

m_anglesAprioriSigma.clear();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be moved down to where it is actually set.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it even necessary to clear them? I'm guessing they are there from when this was implemented as the setFromPvl method, but since it's a constructor now this will be the first time that they are set anywhere

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's correct these can just go away then.

m_numberCamPosCoefSolved = m_spkSolveDegree + 1;
}

m_positionAprioriSigma.clear();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should also be moved down to where it is actually set.

}
}

if (csolve != "NONE") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be checking m_instrumentPointingSolveOption

(double)(scParameterGroup.findKeyword("CAMERA_ANGULAR_ACCELERATION_SIGMA")));
}

if (ssolve != "NONE") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here this should check m_instrumentPositionSolveOption

if (scParameterGroup.hasKeyword("CAMERA_ANGULAR_ACCELERATION_SIGMA"))
m_anglesAprioriSigma.append(
(double)(scParameterGroup.findKeyword("CAMERA_ANGULAR_ACCELERATION_SIGMA")));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

based on setInstrumentPointingSettings, the m_anglesAprioriSigma list needs have m_numberCamAngleCoefSolved elements and any sigmas that are not passed in should be set to ISIS::Null. So each of this ifs needs to have an else that appends a Null.

if (scParameterGroup.hasKeyword("SPACECRAFT_VELOCITY_SIGMA"))
m_positionAprioriSigma.append((double)(scParameterGroup.findKeyword("SPACECRAFT_VELOCITY_SIGMA")));
if (scParameterGroup.hasKeyword("SPACECRAFT_ACCELERATION_SIGMA"))
m_positionAprioriSigma.append((double)(scParameterGroup.findKeyword("SPACECRAFT_ACCELERATION_SIGMA")));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, each if here should have an else that appends an ISIS::Null

if (scParameterGroup.hasKeyword("CAMERA_ANGULAR_ACCELERATION_SIGMA"))
m_anglesAprioriSigma.append(
(double)(scParameterGroup.findKeyword("CAMERA_ANGULAR_ACCELERATION_SIGMA")));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should also look for ADDITIONAL_CAMERA_POINTING_SIGMAS and append whatever is passed in to m_anglesAprioriSigma

if (scParameterGroup.hasKeyword("SPACECRAFT_VELOCITY_SIGMA"))
m_positionAprioriSigma.append((double)(scParameterGroup.findKeyword("SPACECRAFT_VELOCITY_SIGMA")));
if (scParameterGroup.hasKeyword("SPACECRAFT_ACCELERATION_SIGMA"))
m_positionAprioriSigma.append((double)(scParameterGroup.findKeyword("SPACECRAFT_ACCELERATION_SIGMA")));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, look for ADDITIONAL_SPACECRAFT_POSITION_SIGMAS and append those to m_positionAprioriSigma

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how this would look. In the ADDITIONAL_SPACECRAFT_POSITION_SIGMAS keyword, would it contain a list of doubles and then I would loop through that list and append them all? I'm also guessing I don't need to append null if this keyword isn't found

Copy link
Contributor

@jessemapel jessemapel Dec 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be an array of doubles, you can use PvlKeyword::size and PvlKeyword::operator[](int index) to loop through the values and append them. It is purely for sigmas past the acceleration so if it's not there you don't need to pad.

Copy link
Contributor

@jessemapel jessemapel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New BOSS constructor also needs a test

m_anglesAprioriSigma.append((double)(scParameterGroup.findKeyword("CAMERA_ANGLES_SIGMA")));
if (scParameterGroup.hasKeyword("CAMERA_ANGULAR_VELOCITY_SIGMA"))
m_anglesAprioriSigma.append(
if (m_instrumentPointingSolveOption) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an enumeration I would check m_instrumentPointingSolveOption != NoPointingFactors

m_positionAprioriSigma.append((double)(scParameterGroup.findKeyword("SPACECRAFT_VELOCITY_SIGMA")));
if (scParameterGroup.hasKeyword("SPACECRAFT_ACCELERATION_SIGMA"))
m_positionAprioriSigma.append((double)(scParameterGroup.findKeyword("SPACECRAFT_ACCELERATION_SIGMA")));
if (m_instrumentPositionSolveOption) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as for pointing, check m_instrumentPositionSolveOption != NoPositionFactors

for (int i = 0; i < additionalSigmas.size(); i++ ) {
m_positionAprioriSigma.append(toDouble(additionalSigmas[i]));
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good, the pointing needs to have similar logic for ADDITIONAL_CAMERA_POINTING_SIGMAS

@paarongiroux
Copy link
Contributor Author

Pushed my changes with the nearly complete gtest for the BundleObservationSolveSettings class.
the SaveSettings is missing some EXPECT statements for the instrument position options in the xml. I also didn't get around to writing a test for the constructor that takes in a Project object. Not really sure how I would have tested that anyways.

As for the jigsaw stuff, we still need to update truth data of existing tests and add a couple of new ones after this PR is merged.

@jessemapel jessemapel mentioned this pull request Mar 23, 2020
11 tasks
@jessemapel
Copy link
Contributor

See #3792 for the continuation of this PR as Aaron is not working on it.

@jessemapel jessemapel closed this Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants