Skip to content

Commit

Permalink
Writing 0 Value Residuals to PVL (#3194)
Browse files Browse the repository at this point in the history
* Allowed writting of residuals when value is zero to controlnet pvl

* Updated ControlNetVersioner unit test
  • Loading branch information
acpaquette authored Mar 29, 2019
1 parent 5b84e3f commit 3f568f4
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -501,15 +501,13 @@ namespace Isis {
"pixels");
}

if ( controlMeasure.GetSampleResidual() != Isis::Null
&& controlMeasure.GetSampleResidual() != 0. ) {
if ( controlMeasure.GetSampleResidual() != Isis::Null ) {
pvlMeasure += PvlKeyword("SampleResidual",
toString(controlMeasure.GetSampleResidual()),
"pixels");
}

if ( controlMeasure.GetLineResidual() != Isis::Null
&& controlMeasure.GetLineResidual() != 0. ) {
if ( controlMeasure.GetLineResidual() != Isis::Null ) {
pvlMeasure += PvlKeyword("LineResidual", toString(controlMeasure.GetLineResidual()),
"pixels");
}
Expand Down Expand Up @@ -1675,7 +1673,7 @@ namespace Isis {
pointByteTotal += writeFirstPoint(&output);
}

// // Insert header at the beginning of the file once writing is done.
// Insert header at the beginning of the file once writing is done.
ControlNetFileHeaderV0005 protobufHeader;

protobufHeader.set_networkid(m_header.networkID.toLatin1().data());
Expand Down
72 changes: 41 additions & 31 deletions isis/src/control/objs/ControlNetVersioner/ControlNetVersioner.truth
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,25 @@ Object = ControlNetwork
End_Group

Group = ControlMeasure
SerialNumber = M1
MeasureType = Candidate
ChooserName = Unknown
DateTime = 2018-01-09
Sample = 1.0
Line = 1.0
SerialNumber = M1
MeasureType = Candidate
ChooserName = Unknown
DateTime = 2018-01-09
Sample = 1.0
Line = 1.0
SampleResidual = 0.0 <pixels>
LineResidual = 0.0 <pixels>
End_Group

Group = ControlMeasure
SerialNumber = M2
MeasureType = Candidate
ChooserName = Unknown
DateTime = 2018-01-09
Sample = 1.0
Line = 1.0
SerialNumber = M2
MeasureType = Candidate
ChooserName = Unknown
DateTime = 2018-01-09
Sample = 1.0
Line = 1.0
SampleResidual = 0.0 <pixels>
LineResidual = 0.0 <pixels>
End_Group
End_Object
End_Object
Expand Down Expand Up @@ -80,31 +84,37 @@ Object = ControlNetwork
DateTime = 2018-01-19

Group = ControlMeasure
SerialNumber = Cassini-Huygens/ISSNA/1/1467436709.122
MeasureType = RegisteredPixel
ChooserName = Unknown
DateTime = 2018-01-19
Sample = 893.0
Line = 616.0
SerialNumber = Cassini-Huygens/ISSNA/1/1467436709.122
MeasureType = RegisteredPixel
ChooserName = Unknown
DateTime = 2018-01-19
Sample = 893.0
Line = 616.0
SampleResidual = 0.0 <pixels>
LineResidual = 0.0 <pixels>
End_Group

Group = ControlMeasure
SerialNumber = Cassini-Huygens/ISSNA/1/1467443189.122
MeasureType = RegisteredPixel
ChooserName = Unknown
DateTime = 2018-01-19
Sample = 799.25
Line = 701.21
Reference = True
SerialNumber = Cassini-Huygens/ISSNA/1/1467443189.122
MeasureType = RegisteredPixel
ChooserName = Unknown
DateTime = 2018-01-19
Sample = 799.25
Line = 701.21
SampleResidual = 0.0 <pixels>
LineResidual = 0.0 <pixels>
Reference = True
End_Group

Group = ControlMeasure
SerialNumber = Cassini-Huygens/ISSNA/1/1467454012.125
MeasureType = RegisteredPixel
ChooserName = Unknown
DateTime = 2018-01-19
Sample = 569.01
Line = 807.23
SerialNumber = Cassini-Huygens/ISSNA/1/1467454012.125
MeasureType = RegisteredPixel
ChooserName = Unknown
DateTime = 2018-01-19
Sample = 569.01
Line = 807.23
SampleResidual = 0.0 <pixels>
LineResidual = 0.0 <pixels>
End_Group
End_Object
End_Object
Expand Down

0 comments on commit 3f568f4

Please sign in to comment.