Changeset 5462 for trunk/archive/scripts/src/phase2/pmSubtractBias.c
- Timestamp:
- Nov 2, 2005, 3:30:32 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/archive/scripts/src/phase2/pmSubtractBias.c
r5107 r5462 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $9 * @date $Date: 2005- 09-23 02:58:30$8 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-11-03 01:30:32 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 22 22 #define PM_SUBTRACT_BIAS_SPLINE_ORDER 3 23 23 24 // XXX: put these in psConstants.h 25 void PS_POLY1D_PRINT(psPolynomial1D *poly) 26 { 27 printf("-------------- PS_POLY1D_PRINT() --------------\n"); 28 printf("poly->nX is %d\n", poly->nX); 29 for (psS32 i = 0 ; i < (1 + poly->nX) ; i++) { 30 printf("poly->coeff[%d] is %f\n", i, poly->coeff[i]); 31 } 32 } 33 34 void PS_PRINT_SPLINE(psSpline1D *mySpline) 35 { 36 printf("-------------- PS_PRINT_SPLINE() --------------\n"); 37 printf("mySpline->n is %d\n", mySpline->n); 38 for (psS32 i = 0 ; i < mySpline->n ; i++) { 39 PS_POLY1D_PRINT(mySpline->spline[i]); 40 } 41 PS_VECTOR_PRINT_F32(mySpline->knots); 42 } 43 44 #define PS_IMAGE_PRINT_F32_HIDEF(NAME) \ 45 printf("======== printing %s ========\n", #NAME); \ 46 for (int i = 0 ; i < (NAME)->numRows ; i++) { \ 47 for (int j = 0 ; j < (NAME)->numCols ; j++) { \ 48 printf("%.5f ", (NAME)->data.F32[i][j]); \ 49 } \ 50 printf("\n"); \ 51 }\ 52 24 53 /****************************************************************************** 25 54 psSubtractFrame(): this routine will take as input a readout for the input 26 55 image and a readout for the bias image. The bias image is subtracted in 27 56 place from the input image. 28 *****************************************************************************/57 *****************************************************************************/ 29 58 static pmReadout *SubtractFrame(pmReadout *in, 30 59 const pmReadout *bias) … … 143 172 return(opt); 144 173 } 174 175 145 176 146 177 /****************************************************************************** … … 161 192 psTrace(".psModule.pmSubtracBias.ScaleOverscanVector", 4, 162 193 "---- ScaleOverscanVector() begin (%d -> %d) ----\n", overscanVector->n, n); 194 // PS_VECTOR_PRINT_F32(overscanVector); 163 195 164 196 if (NULL == overscanVector) { … … 182 214 psF32 x; 183 215 psS32 i; 184 216 printf("Got here\n"); 185 217 if (fit == PM_FIT_POLYNOMIAL) { 186 218 // Fit a polynomial to the old overscan vector. … … 204 236 // Fit a spline to the old overscan vector. 205 237 mySpline = (psSpline1D *) fitSpec; 238 // XXX: Does it make any sense to have a psSpline argument? 206 239 if (mySpline == NULL) { 207 240 mustFreeSpline = 1; … … 210 243 // 211 244 // NOTE: Since the X arg in the psVectorFitSpline1D() function is NULL, 212 // splines en points will be from 0.0 to overscanVector->n-1. Must scale245 // splines endpoints will be from 0.0 to overscanVector->n-1. Must scale 213 246 // properly when doing the spline eval. 214 247 // 215 mySpline = psVectorFitSpline1D(mySpline, NULL, overscanVector, NULL); 248 // mySpline = psVectorFitSpline1D(mySpline, NULL, overscanVector, NULL); 249 mySpline = psVectorFitSpline1D(NULL, overscanVector); 216 250 if (mySpline == NULL) { 217 251 psError(PS_ERR_UNKNOWN, false, "ScaleOverscanVector()(2): Could not fit a spline to the psVector.\n"); 218 252 return(NULL); 219 253 } 254 // PS_PRINT_SPLINE(mySpline); 220 255 221 256 // For each element of the new vector, convert the x-ordinate to that … … 230 265 psFree(mySpline); 231 266 } 267 // PS_VECTOR_PRINT_F32(newVec); 268 232 269 233 270 } else { … … 376 413 tmpOverscan = (psListElem *) overscans->head; 377 414 while (NULL != tmpOverscan) { 415 // PS_IMAGE_PRINT_F32_HIDEF(in->image); 378 416 myOverscanImage = (psImage *) tmpOverscan->data; 379 417 … … 557 595 } 558 596 } else if (fit == PM_FIT_SPLINE) { 597 // XXX: This makes no sense 598 // XXX: must free mySpline? 559 599 mySpline = (psSpline1D *) fitSpec; 560 mySpline = psVectorFitSpline1D( mySpline, NULL, overscanVector, NULL);600 mySpline = psVectorFitSpline1D(NULL, overscanVector); 561 601 if (mySpline == NULL) { 562 602 psError(PS_ERR_UNKNOWN, false, "Could not fit a spline to overscan vector. Returning in image.\n");
Note:
See TracChangeset
for help on using the changeset viewer.
