IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34471


Ignore:
Timestamp:
Sep 25, 2012, 6:08:46 PM (14 years ago)
Author:
watersc1
Message:

Quick clean up of some debug statements that aren't required anymore.

Location:
branches/czw_branch/20120906
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20120906/psLib/src/imageops/psImageInterpolate.c

    r34470 r34471  
    951951  if (xl < 0) { xl = 0; }
    952952  if (xl >= image->numCols) {xl = image->numCols - 1; }
    953     //{ *imageValue = NAN; return PS_INTERPOLATE_STATUS_GOOD; }
    954953  xh = xl + 1;
    955954  if (xh >= image->numCols) {xh = image->numCols - 1; }
    956     //{ *imageValue = NAN; return PS_INTERPOLATE_STATUS_GOOD; }
    957     //
     955
    958956  yl = floor(y);
    959957  if (yl < 0) { yl = 0; }
    960958  if (yl >= image->numRows) {yl = image->numRows - 1; }
    961     //{ *imageValue = NAN; return PS_INTERPOLATE_STATUS_GOOD; }
    962   //
    963959  yh = yl + 1;
    964960  if (yh >= image->numRows) {yh = image->numRows - 1; }
    965     //{ *imageValue = NAN; return PS_INTERPOLATE_STATUS_GOOD; }
    966   //
     961
    967962  if (imageValue && image) {
    968963    if (image->data.F32[yl][xl] == image->data.F32[yl][xh]) {
     
    989984    }
    990985  }
     986#if (0)
    991987  if (*imageValue == 0.0) {
    992988    fprintf(stderr,"IJK: Zero!: %g %g [%d %d %d %d] %g %g (%g %g %g %g)\n",
     
    995991            );
    996992  }
     993#endif
    997994  return PS_INTERPOLATE_STATUS_GOOD;
    998995}
  • branches/czw_branch/20120906/pswarp/src/pswarp.h

    r34470 r34471  
    9494
    9595pswarpMapGrid *pswarpMapGridFromImage (pmReadout *dest, pmReadout *src, int nXpix, int nYpix);
    96 pswarpMapGrid *pswarpMapGridFromImageForBackground (pmReadout *dest, pmReadout *src, int nXpix, int nYpix);
    9796bool pswarpMapGridSetGrid (pswarpMapGrid *grid, int ix, int iy, int *gridX, int *gridY);
    9897bool pswarpMapGridCoordRange (pswarpMapGrid *grid, int gridX, int gridY, psPlane *min, psPlane *max);
  • branches/czw_branch/20120906/pswarp/src/pswarpLoop.c

    r34470 r34471  
    159159        }
    160160    }
    161     pmAstromWCS *WCSF = pmAstromWCSfromHeader(phu->header);
    162    
    163     fprintf(stderr,"WCSFI: %g %g : %g %g : %g %g : %g %g %g %g : %g %g\n",
    164             WCSF->crval1,WCSF->crval2,
    165             WCSF->crpix1,WCSF->crpix2,
    166             WCSF->cdelt1,WCSF->cdelt2,
    167             WCSF->trans->x->coeff[1][0],
    168             WCSF->trans->x->coeff[0][1],
    169             WCSF->trans->y->coeff[1][0],
    170             WCSF->trans->y->coeff[0][1],
    171             -1.0,-1.0);
    172     psFree(WCSF);
     161
    173162    psList *cells = psListAlloc(NULL);  // List of cells, for concepts averaging
    174163
     
    208197            }
    209198        }
    210     pmAstromWCS *WCSF = pmAstromWCSfromHeader(hdu->header);
    211    
    212     fprintf(stderr,"WCSFIB: %g %g : %g %g : %g %g : %g %g %g %g : %g %g\n",
    213             WCSF->crval1,WCSF->crval2,
    214             WCSF->crpix1,WCSF->crpix2,
    215             WCSF->cdelt1,WCSF->cdelt2,
    216             WCSF->trans->x->coeff[1][0],
    217             WCSF->trans->x->coeff[0][1],
    218             WCSF->trans->y->coeff[1][0],
    219             WCSF->trans->y->coeff[0][1],
    220             -1.0,-1.0);
    221     psFree(WCSF);
    222 
    223199       
    224200        pmCell *cell;
  • branches/czw_branch/20120906/pswarp/src/pswarpMapGrid.c

    r34470 r34471  
    5252    return grid;
    5353}
    54 /**
    55  * pswarpMapGridFromImageForBackground builds a set (a grid) of locally-linear maps which convert the source
    56  * coordinates (src) to destination coordinates (dest).  we construct a grid with superpixel
    57  * spacing of nXpix, nYpix.  The transformation for each grid cell is valid for the superpixel.
    58  * The grid over-fills the source image so every source image pixel is guaranteed to have a map.
    59  */
    60 pswarpMapGrid *pswarpMapGridFromImageForBackground (pmReadout *dest, pmReadout *src, int nXpix, int nYpix) {
    61 
    62     int i, ni;
    63     int j, nj;
    64 
    65     // start counting from the center of the superpixels
    66     double xMin = 0.5*nXpix;
    67     double yMin = 0.5*nYpix;
    68 
    69     // the map is defined for coordinates in the image parent frame.
    70     int Nx = src->image->numCols + src->image->col0;
    71     int Ny = src->image->numRows + src->image->row0;
    72 
    73     // always allocate an extra superpixel to handle spillover
    74     int nXpts = (int)(Nx / nXpix) + 1;
    75     int nYpts = (int)(Ny / nYpix) + 1;
    76 
    77     // create the grid of maps
    78     pswarpMapGrid *grid = pswarpMapGridAlloc (nXpts, nYpts);
    79 
    80     // measure the map for the center of each superpixel
    81     for (ni = 0, i = xMin; ni < nXpts; i += nXpix, ni++) {
    82         for (nj = 0, j = yMin; nj < nYpts; j += nYpix, nj++) {
    83             pswarpMapSetLocalModel (grid->maps[ni][nj], dest, src, i, j);
    84 /*          grid->maps[ni][nj]->Xo += (13.0 * 400.0 - 4846.0) / 2.0; */
    85 /*          grid->maps[ni][nj]->Yo += (13.0 * 400.0 - 4868.0) / 2.0; */
    86         }
    87     }
    88 
    89     grid->nXpix = nXpix;
    90     grid->nYpix = nYpix;
    91     grid->xMin = xMin;
    92     grid->yMin = yMin;
    93     return grid;
    94 }
    9554
    9655/**
  • branches/czw_branch/20120906/pswarp/src/pswarpTransformReadout.c

    r34470 r34471  
    6060    // pswarpMapGridFromImage builds a set of locally-linear maps which convert the
    6161    // output coordinates to input coordinates
    62     pswarpMapGrid *grid;
    63     if (psMetadataLookupBool(NULL,config->arguments,"BACKGROUND_WARPING")) {
    64       grid = pswarpMapGridFromImageForBackground(input, output, nGridX, nGridY);
    65     }
    66     else {
    67       grid = pswarpMapGridFromImage(input, output, nGridX, nGridY);
    68     }
     62    pswarpMapGrid *grid = pswarpMapGridFromImage(input, output, nGridX, nGridY);
     63    //    if (psMetadataLookupBool(NULL,config->arguments,"BACKGROUND_WARPING")) {
     64   
    6965    // XXX optionally modify the grid based on this result and force the maxError < XXX
    7066    double maxError = pswarpMapGridMaxError(grid); // Maximum (positional) error from using grid
     
    177173        } else {
    178174            pswarpTransformTileArgs *args = job->args->data[0];
    179             //      fprintf (stderr, "finished job %d,%d, Nargs: %ld (%d %d %d %d) (%d %d %d %d)\n", args->gridX, args->gridY, job->args->n,
    180             //               xMin,xMax,yMin,yMax,args->xMin,args->xMax,args->yMin,args->yMax);
    181175            goodPixels += args->goodPixels;
    182176            xMin = PS_MIN(args->xMin, xMin);
  • branches/czw_branch/20120906/pswarp/src/pswarpTransformTile.c

    r34470 r34471  
    8383    // Iterate over the output image pixels (parent frame)
    8484    long goodPixels = 0;                ///< Number of input pixels landing on the output image
    85     psTrace("pswarp",3,"Size: %d %d\n",xMax,yMax);
     85
    8686    for (int y = yMin; y < yMax; y++) {
    8787        for (int x = xMin; x < xMax; x++) {
     
    9595            pswarpMapApply(&xIn, &yIn, map, x + 0.5, y + 0.5);
    9696
     97            // This needs to use a more reliable method to do this offset and limiting
    9798            if (args->interp->mode == 8) {
    98               xIn += 177.0 / 400.0;
    99               yIn += 166.0 / 400.0;
     99              double xOffset = 177.0 / 400.0; // (modelsize * modelbinning - xsize) / 2.0
     100              double yOffset = 166.0 / 400.0; // (modelsize * modelbinning - ysize) / 2.0
     101              xIn += xOffset;
     102              yIn += yOffset;
    100103
    101               if ((xIn > inNumCols - 177.0/ 400.0)||
    102                   (yIn > inNumRows - 166.0/ 400.0)||
    103                   (xIn < 177.0/ 400.0)||
    104                   (yIn < 166.0/ 400.0)
    105                  
    106                   ) {
    107                 fprintf(stderr,"\n");
     104              if ((xIn > inNumCols - xOffset)||
     105                  (yIn > inNumRows - yOffset)||
     106                  (xIn < xOffset)||
     107                  (yIn < yOffset)) {
    108108                continue;
    109109              }
     
    124124            int xOut = x - outCol0, yOut = y - outRow0; ///< Position on output image
    125125
    126             if (((xOut % 500) == 0)&&((yOut % 500) == 0)) {
    127               fprintf(stderr,"%d %d %g %g %d %d (%d %d %d %d) %g %g %g\n",
    128                       x,y,xIn,yIn,xOut,yOut,xMin,xMax,yMin,yMax,imageValue,
    129                       (4846 - 400 * (12)) / 2.0,
    130                       (4868 - 400 * (12)) / 2.0
    131                      
    132                       );
    133             }
    134            
    135 /*          if ((xIn >= args->interp->image->numCols - 1)|| */
    136 /*              (yIn >= args->interp->image->numRows - 1)) { */
    137 /*            imageValue = NAN; */
    138 /*          } */
    139126            if (outImageData) {
    140127                outImageData[yOut][xOut] = imageValue * jacobian;
Note: See TracChangeset for help on using the changeset viewer.