IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 17780


Ignore:
Timestamp:
May 23, 2008, 11:24:51 AM (18 years ago)
Author:
Paul Price
Message:

Adding range information to stats.

Location:
trunk/pswarp/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/pswarp/src/pswarpPixelFraction.c

    r15610 r17780  
    3939    long numPix = numCols * numRows;
    4040
     41    // Range of valid pixels
     42    int xMin = INT_MAX, xMax = -INT_MAX, yMin = INT_MAX, yMax = -INT_MAX;
     43
    4144    long numBad = 0;                     // Number of bad pixels
    4245    for (int y = 0; y < numRows; y++) {
     
    4447            if (mask->data.PS_TYPE_MASK_DATA[y][x] & maskVal) {
    4548                numBad++;
     49            } else {
     50                if (y > yMax) {
     51                    yMax = y;
     52                }
     53                if (y < yMin) {
     54                    yMin = y;
     55                }
     56                if (x > xMax) {
     57                    xMax = x;
     58                }
     59                if (x < xMin) {
     60                    xMin = x;
     61                }
    4662            }
    4763        }
     
    5369    if (stats) {
    5470        psMetadataAddBool(stats, PS_LIST_HEAD, "ACCEPT", 0, "Accept this readout?", accept);
     71
     72        psMetadataAddS32(stats, PS_LIST_TAIL, "RANGE.XMIN", 0, "Minimum valid x value", xMin);
     73        psMetadataAddS32(stats, PS_LIST_TAIL, "RANGE.XMAX", 0, "Maximum valid x value", xMax);
     74        psMetadataAddS32(stats, PS_LIST_TAIL, "RANGE.YMIN", 0, "Minimum valid y value", yMin);
     75        psMetadataAddS32(stats, PS_LIST_TAIL, "RANGE.YMAX", 0, "Maximum valid y value", yMax);
    5576    }
    5677
  • trunk/pswarp/src/pswarpTransformReadout_Opt.c

    r15334 r17780  
    9797        nextGridX = nextGridXo;
    9898        map = grid->maps[gridX][gridY];
     99        int yOut = y - outRow0;         // Position on image
    99100        for (int x = minX; x < maxX; x++) {
    100101            if (x >= nextGridX) {
     
    127128                psError(PS_ERR_UNKNOWN, false, "Unable to interpolate image.");
    128129                psFree(interp);
    129                 psFree (inPix);
    130                 psFree (grid);
     130                psFree(inPix);
     131                psFree(grid);
    131132                return false;
    132133            }
    133             outImageData[y-outRow0][x-outCol0] = imageValue;
     134            int xOut = x - outCol0;     // Position on image
     135            outImageData[yOut][xOut] = imageValue;
    134136            if (inVar) {
    135                 outVarData[y-outRow0][x-outCol0] = varValue;
     137                outVarData[yOut][xOut] = varValue;
    136138            }
    137139            if (outMaskData) {
    138                 outMaskData[y-outRow0][x-outCol0] = maskValue;
    139             }
    140         }
    141     }
    142 
     140                outMaskData[yOut][xOut] = maskValue;
     141            }
     142        }
     143    }
    143144    psFree(interp);
    144     psFree (inPix);
    145     psFree (grid);
     145    psFree(inPix);
     146    psFree(grid);
    146147
    147148    // Transform sources
Note: See TracChangeset for help on using the changeset viewer.