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

Specpix now gives accurate values when opening large cubes with many special pixels.(Ref #1699)

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@6385 41f8697f-d340-4b68-9986-7bafba869bb8
parent 080844a2
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
#include "Isis.h"

#include <vector>
#include <algorithm>
#include <stdio.h>

#include "IException.h"
#include "ProcessByLine.h"
#include "SpecialPixel.h"
#include "IException.h"

using namespace std;
using namespace Isis;
@@ -41,13 +37,20 @@ void addRange(QString minName, QString maxName, SpecPix pixel);

vector <spRange> rangeList;
int numRange;
int nnull, nlis, nlrs, nhis, nhrs;
//tjw:  int -> BigInt
BigInt nnull, nlis, nlrs, nhis, nhrs;




void IsisMain() {
  // We will be processing by line
  ProcessByLine p;


  

  
  nnull = nlis = nlrs = nhis = nhrs = 0;

  // Setup the input and output cubes
@@ -100,7 +103,8 @@ void IsisMain() {
  results += PvlKeyword("Lis", toString(nlis));
  results += PvlKeyword("Hrs", toString(nhrs));
  results += PvlKeyword("His", toString(nhis));
  int total = nnull + nlrs + nhrs + nlis + nhis;
  //tjw:  int total -> BigInt total
  BigInt total = nnull + nlrs + nhrs + nlis + nhis;
  results += PvlKeyword("Total", toString(total));

  Application::Log(results);
@@ -119,6 +123,7 @@ void specpix(Buffer &in, Buffer &out) {
          if (in[i] >= rangeList[rng].min && in[i] <= rangeList[rng].max) {
            out[i] = NULL8;
            nnull++;
   
          }
          break;

+6 −1
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>

<application name="specpix" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://isis.astrogeology.usgs.gov/Schemas/Application/application.xsd">
<application name="specpix" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation=
  "http://isis.astrogeology.usgs.gov/Schemas/Application/application.xsd">

  <brief>
    Replace user specified pixels with Isis special pixel values
@@ -41,6 +43,9 @@
    <change name="Travis Addair" date="2011-08-31">
      Changed to allow ranges of a single DN
    </change>
    <change name = "David Miller" date = "2015-09-04">
     	Changed type of count variables to BigInt to avoid wrap around
    </change>	

  </history>