IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 14, 2012, 6:10:32 PM (14 years ago)
Author:
watersc1
Message:

Still doesn't work correctly. I've simplified and corrected the problems I was having before, but I still have residuals of ~50 pixels in the warped background model relative to the science warp. I'm beginning to think that there's some issue with the interpolated background model, and that it's not quite the correct size? That's pretty much all I can think of at this point.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20120906/pswarp/src/pswarpTransformTile.c

    r29331 r34442  
    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);
    8586    for (int y = yMin; y < yMax; y++) {
    8687        for (int x = xMin; x < xMax; x++) {
     88/*        if ((x == 931)||(x == 717)||(x == 924)) { */
     89/* /\*      if ((y == 1348)||(y == 1249)||(y == 1081)) { *\/ */
     90/* /\*        fprintf(stderr,"BEcause: %d %d [%d %d %d %d]\n",x,y,yMin,yMax,xMin,xMax); *\/ */
     91/* /\*      } *\/ */
     92/*        } */
     93            if (((x == 931)&&(y == 1348))||
     94                ((x == 717)&&(y == 1249))||
     95                ((x == 924)&&(y == 1081))) {
     96              psTrace("pswarp",3,"TT: A\n");
     97              psTrace("pswarp",3,"TT: %d %d %d %d\n",xMin,xMax,yMin,yMax);
     98
     99            }
    87100
    88101            // Only transform those pixels requested
     
    90103                continue;
    91104            }
     105            if (((x == 931)&&(y == 1348))||
     106                ((x == 717)&&(y == 1249))||
     107                ((x == 924)&&(y == 1081))) {
     108              psTrace("pswarp",3,"TT: B\n");
     109              psTrace("pswarp",3,"TT: %d %d %d %d\n",xMin,xMax,yMin,yMax);
     110
     111            }
    92112
    93113            // pswarpMapApply converts the output coordinate (x,y) to the input coordinate.
     
    95115            double xIn, yIn;            // Input pixel coordinates
    96116            pswarpMapApply(&xIn, &yIn, map, x + 0.5, y + 0.5);
     117            if (((x == 931)&&(y == 1348))||
     118                ((x == 717)&&(y == 1249))||
     119                ((x == 924)&&(y == 1081))) {
     120              psTrace("pswarp",3,"TT: Ct\n");
     121              psTrace("pswarp",3,"TT: %d %d %d %d %g %g %d %d\n",xMin,xMax,yMin,yMax,xIn,yIn,inNumCols,inNumRows);
     122
     123            }
     124
    97125            if (xIn < 0 || xIn >= inNumCols || yIn < 0 || yIn >= inNumRows) {
    98126                continue;
    99127            }
     128            if (((x == 931)&&(y == 1348))||
     129                ((x == 717)&&(y == 1249))||
     130                ((x == 924)&&(y == 1081))) {
     131              psTrace("pswarp",3,"TT: C\n");
     132              psTrace("pswarp",3,"TT: %d %d %d %d\n",xMin,xMax,yMin,yMax);
     133
     134            }
    100135
    101136            // psImagePixelInterpolate determines the value at pixel coordinate (x,y) in child coordinates
     
    109144            int xOut = x - outCol0, yOut = y - outRow0; ///< Position on output image
    110145
     146            if ((xIn >= args->interp->image->numCols - 1)||
     147                (yIn >= args->interp->image->numRows - 1)) {
     148              imageValue = NAN;
     149            }
    111150            if (outImageData) {
    112151                outImageData[yOut][xOut] = imageValue * jacobian;
     
    120159
    121160            goodPixels++;
     161
     162            if ((x == 931)||(x == 717)||(x == 924)) {
     163              if ((y == 1348)||(y == 1249)||(y == 1081)) {
     164              psTrace("pswarp",3,"TT: %d %d %g %g %d %d %g %g (%g) %ld %g %g %g %g\n",x,y,xIn,yIn,xOut,yOut,imageValue,jacobian,
     165                      args->input->image->data.F32[(int) yIn][(int) xIn],(long) args->interp,
     166                      0.0,0.0,0.0,0.0);
     167/*                    inImage->data.F32[(int) yIn][(int) xIn], */
     168/*                    inImage->data.F32[(int) yIn+1][(int) xIn], */
     169/*                    inImage->data.F32[(int) yIn+1][(int) xIn+1], */
     170/*                    inImage->data.F32[(int) yIn][(int) xIn+1]); */
     171              psTrace("pswarp",3,"TT: %d %d %d %d\n",xMin,xMax,yMin,yMax);
     172              }
     173            }
     174           
     175            if (((xOut == 931)&&(yOut == 1348))||
     176                ((xOut == 717)&&(yOut == 1249))||
     177                ((xOut == 924)&&(yOut == 1081))) {
     178              psTrace("pswarp",3,"TT: %d %d %g %g %d %d %g %g (%g) %ld %g %g %g %g\n",x,y,xIn,yIn,xOut,yOut,imageValue,jacobian,
     179                      args->input->image->data.F32[(int) yIn][(int) xIn],(long) args->interp,
     180                                      0.0,0.0,0.0,0.0);
     181/*                    inImage->data.F32[(int) yIn][(int) xIn], */
     182/*                    inImage->data.F32[(int) yIn+1][(int) xIn], */
     183/*                    inImage->data.F32[(int) yIn+1][(int) xIn+1], */
     184/*                    inImage->data.F32[(int) yIn][(int) xIn+1]); */
     185              psTrace("pswarp",3,"TT: %d %d %d %d\n",xMin,xMax,yMin,yMax);
     186
     187            }
     188            if ((xOut ==  443)&&(yOut == 659)) {
     189              psTrace("pswarp",3,"TT: %d %d %g %g %d %d %g %g (%g) %ld\n",x,y,xIn,yIn,xOut,yOut,imageValue,jacobian,
     190                      args->input->image->data.F32[(int) yIn][(int) xIn],(long) args->interp);
     191              psTrace("pswarp",3,"TT: %d %d %d %d\n",xMin,xMax,yMin,yMax);
     192
     193            }
     194            if ((xOut ==  524)&&(yOut == 576)) {
     195              psTrace("pswarp",3,"TT: %d %d %g %g %d %d %g %g (%g) %ld\n",x,y,xIn,yIn,xOut,yOut,imageValue,jacobian,
     196                      args->input->image->data.F32[(int) yIn][(int) xIn],(long) args->interp);
     197              psTrace("pswarp",3,"TT: %d %d %d %d\n",xMin,xMax,yMin,yMax);
     198             
     199            }
    122200        }
    123201    }
Note: See TracChangeset for help on using the changeset viewer.