Commit ff5066f4 authored by Tyler Wilson's avatar Tyler Wilson
Browse files

cnetcombinept now merges control points correctly, sets control measures types...

cnetcombinept now merges control points correctly, sets control measures types to candidate correctly, and sets a priori lat/lon correctly to adjusted values.  Fixes #4870,4772,4869.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@7814 41f8697f-d340-4b68-9986-7bafba869bb8
parent 6f78d8cc
Loading
Loading
Loading
Loading
+18 −3
Original line number Diff line number Diff line
@@ -145,6 +145,7 @@ namespace Isis {
  int ControlPointMerger::merge(ControlPoint *source, ControlPoint *candidate, 
                                const Statistics &stats) {
    int nMerged(0);
    bool setCandidateType = true;

    // Gut check to ensure we don't merge into ourself
    if ( source != candidate ) {
@@ -158,6 +159,16 @@ namespace Isis {

      // Consider only valid measures                  
      QList<ControlMeasure*> measures = candidate->getMeasures(true); 

      //Check to see if reference measures for both source/candidate are the same.
      if (source->GetRefMeasure() == candidate->GetRefMeasure()) {


        setCandidateType = false;

      }


      BOOST_FOREACH ( ControlMeasure *m, measures ) {
        if ( !source->HasSerialNumber(m->GetCubeSerialNumber()) ) {
          QScopedPointer<ControlMeasure> p_m(new ControlMeasure(*m));
@@ -166,15 +177,19 @@ namespace Isis {
          if ( candidate->GetRefMeasure() == m ) {
            p_m->SetResidual(residual, residual);
            p_m->SetLogData(data);
          }


          }
          if (setCandidateType) {
            p_m->SetType(ControlMeasure::Candidate);
          }
          source->Add( p_m.take() ); 
          nMerged++;
        }
      }
      // Essentially disables this point meaning this point is already merged 
      // with another
      if (nMerged > 0) candidate->SetIgnored(true);
      candidate->SetIgnored(true);
    }

    return ( nMerged );
+2 −2
Original line number Diff line number Diff line
@@ -364,7 +364,7 @@ void IsisMain() {
      if ( isValid(m_p) ) {  // Handle valid points
        if ( !cnet.isNull() ) {
          if ( (true == setaprioribest) && !m_p->IsEditLocked() ) {
            m_p->SetAdjustedSurfacePoint(m_p->GetBestSurfacePoint());
            m_p->SetAprioriSurfacePoint(m_p->GetBestSurfacePoint());
          }
          cnet->AddPoint(m_p);
          oPoints++;
@@ -380,7 +380,7 @@ void IsisMain() {
    else {  // Handle points when not cleaning
      if ( !cnet.isNull() ) {
        if ( (true == setaprioribest) && !m_p->IsEditLocked() ) {
          m_p->SetAdjustedSurfacePoint(m_p->GetBestSurfacePoint());
          m_p->SetAprioriSurfacePoint(m_p->GetBestSurfacePoint());
        }

        cnet->AddPoint(m_p); 
+11 −0
Original line number Diff line number Diff line
@@ -65,6 +65,17 @@
    <change name="Jesse Mapel" date="2016-12-06">
      Created new tests and updated documentation. References #4558.
    </change>
    <change name="Tyler Wilson" date="2017-06-29">
      Modified ControlPointMerger::merge function to properly hand combining control points
      that contain the same control measures in each point.  Fixes #4869.
    </change>
    <change name="Tyler Wilson" date="2017-06-29">
      Modified ControlPointMerger::merge function so that merged control measure types
      are set to candidate (except when they have the same reference measure).  Fixes #4870.
    </change>
    <change name="Tyler Wilson" date="2017-06-29">
      cnetcombinept now properly sets apriori lat/lon values to adjusted values.  Fixes #4772.
    </change>
  </history>

  <category>
+10 −0
Original line number Diff line number Diff line
APPNAME = cnetcombinept

include $(ISISROOT)/make/isismake.tsts
#cnetcombinept cnetbase=Extract_thmir_dups.net onet=out.net
commands:
	$(CP) $(INPUT)/*.net $(OUTPUT)
	$(APPNAME) cnetbase=$(INPUT)/Extract_thmir_dups.net \
	onet=$(OUTPUT)/testout_Extract_thmir_dups.net > /dev/null;

	$(RM) $(OUTPUT)/Extract_thmir_dups.net;