Unverified Commit 3f568f4a authored by acpaquette's avatar acpaquette Committed by GitHub
Browse files

Writing 0 Value Residuals to PVL (#3194)

* Allowed writting of residuals when value is zero to controlnet pvl

* Updated ControlNetVersioner unit test
parent 5b84e3fc
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -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");
        }
@@ -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());
+41 −31
Original line number Diff line number Diff line
@@ -42,6 +42,8 @@ Object = ControlNetwork
      DateTime       = 2018-01-09
      Sample         = 1.0
      Line           = 1.0
      SampleResidual = 0.0 <pixels>
      LineResidual   = 0.0 <pixels>
    End_Group

    Group = ControlMeasure
@@ -51,6 +53,8 @@ Object = ControlNetwork
      DateTime       = 2018-01-09
      Sample         = 1.0
      Line           = 1.0
      SampleResidual = 0.0 <pixels>
      LineResidual   = 0.0 <pixels>
    End_Group
  End_Object
End_Object
@@ -86,6 +90,8 @@ Object = ControlNetwork
      DateTime       = 2018-01-19
      Sample         = 893.0
      Line           = 616.0
      SampleResidual = 0.0 <pixels>
      LineResidual   = 0.0 <pixels>
    End_Group

    Group = ControlMeasure
@@ -95,6 +101,8 @@ Object = ControlNetwork
      DateTime       = 2018-01-19
      Sample         = 799.25
      Line           = 701.21
      SampleResidual = 0.0 <pixels>
      LineResidual   = 0.0 <pixels>
      Reference      = True
    End_Group

@@ -105,6 +113,8 @@ Object = ControlNetwork
      DateTime       = 2018-01-19
      Sample         = 569.01
      Line           = 807.23
      SampleResidual = 0.0 <pixels>
      LineResidual   = 0.0 <pixels>
    End_Group
  End_Object
End_Object