Changeset 9730 for trunk/psModules/src/detrend
- Timestamp:
- Oct 24, 2006, 12:55:05 PM (20 years ago)
- Location:
- trunk/psModules/src/detrend
- Files:
-
- 5 edited
-
pmFlatNormalize.c (modified) (4 diffs)
-
pmFringeStats.c (modified) (8 diffs)
-
pmShutterCorrection.c (modified) (6 diffs)
-
pmSubtractBias.c (modified) (3 diffs)
-
pmSubtractSky.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/detrend/pmFlatNormalize.c
r9614 r9730 32 32 } else { 33 33 *expFluxesPtr = psVectorAlloc(numExps, PS_TYPE_F32); 34 (*expFluxesPtr)->n = numExps;35 34 } 36 35 expFluxes = psMemIncrRefCounter(*expFluxesPtr); 37 36 } else { 38 37 expFluxes = psVectorAlloc(numExps, PS_TYPE_F32); 39 expFluxes->n = numExps;40 38 } 41 39 … … 47 45 } else { 48 46 *chipGainsPtr = psVectorAlloc(numChips, PS_TYPE_F32); 49 (*chipGainsPtr)->n = numChips;50 47 psVectorInit(*chipGainsPtr, 1.0); 51 48 } … … 53 50 } else { 54 51 chipGains = psVectorAlloc(numChips, PS_TYPE_F32); 55 chipGains->n = numChips;56 52 psVectorInit(chipGains, 1.0); 57 53 } … … 62 58 psImageInit(fluxMask, 0); 63 59 psVector *gainMask = psVectorAlloc(numChips, PS_TYPE_U8); // Mask for bad gains 64 gainMask->n = numChips;65 60 psVectorInit(gainMask, 0); 66 61 psVector *expMask = psVectorAlloc(numExps, PS_TYPE_U8); // Mask for bad exposures 67 expMask->n = numExps;68 62 psVectorInit(expMask, 0); 69 63 for (int i = 0; i < numChips; i++) { -
trunk/psModules/src/detrend/pmFringeStats.c
r9615 r9730 133 133 134 134 psArray *table = psArrayAlloc(numRows); // The table 135 table->n = numRows;136 135 // Translate the vectors into the required format for psFitsWriteTable() 137 136 for (long i = 0; i < numRows; i++) { … … 205 204 psVector *y = psVectorAlloc(numRows, PS_TYPE_F32); // y position 206 205 psVector *mask = psVectorAlloc(numRows, PS_TYPE_U8); // mask 207 x->n = y->n = mask->n = numRows;208 206 regions->x = x; 209 207 regions->y = y; … … 253 251 stats->f = psVectorAlloc(numRegions, PS_TYPE_F32); 254 252 stats->df = psVectorAlloc(numRegions, PS_TYPE_F32); 255 stats->f->n = stats->df->n = numRegions;256 253 257 254 return stats; … … 365 362 // Vectors: f, df 366 363 psArray *table = psArrayAlloc(numRows); // The table 367 table->n = numRows;368 364 // Translate the vectors into the required format for psFitsWriteTable() 369 365 for (long i = 0; i < numRows; i++) { … … 527 523 scale->coeff = psVectorAlloc(nFringeFrames + 1, PS_TYPE_F32); 528 524 scale->coeffErr = psVectorAlloc(nFringeFrames + 1, PS_TYPE_F32); 529 scale->coeff->n = nFringeFrames + 1;530 scale->coeff->n = nFringeFrames + 1;531 525 532 526 return scale; … … 551 545 psImage *A = psImageAlloc(numCoeffs, numCoeffs, PS_TYPE_F64); // The least-squares matrix 552 546 psVector *B = psVectorAlloc(numCoeffs, PS_TYPE_F64); // The least-squares vector 553 B->n = numCoeffs;554 547 555 548 // Generate the least-squares matrix and vector … … 718 711 if (!regions->mask) { 719 712 regions->mask = psVectorAlloc(numRegions, PS_TYPE_U8); 720 regions->mask->n = numRegions;721 713 psVectorInit(regions->mask, 0); 722 714 } … … 725 717 unsigned int numClipped = 0; // Total number clipped 726 718 psVector *diff = psVectorAlloc(numRegions, PS_TYPE_F32); // The differences between obs. and pred. 727 diff->n = numRegions;728 719 729 720 pmFringeScale *scale = pmFringeScaleAlloc(fringes->n); // The fringe scales -
trunk/psModules/src/detrend/pmShutterCorrection.c
r9618 r9730 104 104 psVector *tmpX = psVectorAlloc(2, PS_TYPE_F32); 105 105 psVector *tmpY = psVectorAlloc(2, PS_TYPE_F32); 106 tmpX->n = tmpY->n = 2;107 106 108 107 long index; … … 210 209 psVector *x = psVectorAlloc(exptime->n, PS_TYPE_F32); 211 210 psVector *y = psVectorAlloc(exptime->n, PS_TYPE_F32); 212 x->n = y->n = exptime->n;213 211 214 212 for (long i = 0; i < exptime->n; i++) { … … 301 299 params->data.F32[1] = guess->offset; 302 300 params->data.F32[2] = guess->offref; 303 params->n = 3;304 301 305 302 // XXX for the moment, don't set any constraints … … 317 314 // construct the coordinate and value entries (y is counts) 318 315 psArray *x = psArrayAlloc(exptime->n); // Coordinates 319 x->n = exptime->n;320 316 321 317 for (long i = 0; i < exptime->n; i++) { 322 318 psVector *coord = psVectorAlloc(1, PS_TYPE_F32); 323 coord->n = 1;324 319 coord->data.F32[0] = exptime->data.F32[i]; 325 320 x->data[i] = coord; … … 371 366 psRegion refRegion; // Reference region 372 367 psVector *refs = psVectorAlloc(num, PS_TYPE_F32); // Reference measurements 373 refs->n = num;374 368 psVectorInit(refs, 0); 375 369 psArray *regions = psArrayAlloc(MEASURE_SAMPLES); // Array of sample regions, made on each image 376 regions->n = MEASURE_SAMPLES;377 370 psImage *samplesMean = psImageAlloc(num, MEASURE_SAMPLES, PS_TYPE_F32); // Measurements for each file 378 371 psImage *samplesStdev = psImageAlloc(num, MEASURE_SAMPLES, PS_TYPE_F32); // Errors for each file … … 505 498 psImage *pattern = psImageAlloc(numCols, numRows, PS_TYPE_F32); // Illumination pattern 506 499 psVector *mask = psVectorAlloc(num, PS_TYPE_U8); // Mask for each image 507 mask->n = num;508 500 psVectorInit(mask, 0); 509 501 psTrace("psModules.detrend", 2, "Performing linear fit on individual pixels...\n"); -
trunk/psModules/src/detrend/pmSubtractBias.c
r9619 r9730 129 129 psVector *ordinate = psVectorAlloc(pixels->n, PS_TYPE_F32); // Ordinate 130 130 psVector *mask = psVectorAlloc(pixels->n, PS_TYPE_U8); // Mask for fitting 131 reduced->n = ordinate->n = mask->n = pixels->n;132 131 133 132 for (int i = 0; i < pixels->n; i++) { … … 268 267 // The read direction is rows 269 268 psArray *pixels = psArrayAlloc(image->numRows); // Array of vectors containing pixels 270 pixels->n = image->numRows;271 269 for (int i = 0; i < pixels->n; i++) { 272 270 psVector *values = psVectorAlloc(0, PS_TYPE_F32); … … 312 310 // The read direction is columns 313 311 psArray *pixels = psArrayAlloc(image->numCols); // Array of vectors containing pixels 314 pixels->n = image->numCols;315 312 for (int i = 0; i < pixels->n; i++) { 316 313 psVector *values = psVectorAlloc(0, PS_TYPE_F32); -
trunk/psModules/src/detrend/pmSubtractSky.c
r9541 r9730 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-10- 13 22:11:02$8 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-10-24 22:55:05 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 345 345 psImage *Aout = psImageAlloc(localPolyTerms, localPolyTerms, PS_TYPE_F64); 346 346 psVector *B = psVectorAlloc(localPolyTerms, PS_TYPE_F64); 347 B->n = B->nalloc;348 347 psVector *outPerm = NULL; 349 348 … … 412 411 PS_ASSERT_IMAGE_NON_EMPTY(Aout, NULL); 413 412 psVector *C = psVectorAlloc(localPolyTerms, PS_TYPE_F64); 414 C->n = C->nalloc;415 413 psMatrixLUSolve(C, Aout, B, outPerm); 416 414
Note:
See TracChangeset
for help on using the changeset viewer.
