- Timestamp:
- Jan 28, 2009, 2:33:51 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/pap_branch_20090128/psModules/src/camera/pmHDUGenerate.c
r18227 r21211 274 274 pmReadout *readout = cell->readouts->data[0]; // The first readout, as representative 275 275 // The proper image, used to get the size 276 psImage *image = readout->image ? readout->image : (readout->mask ? readout->mask : readout-> weight);276 psImage *image = readout->image ? readout->image : (readout->mask ? readout->mask : readout->variance); 277 277 if (!image) { 278 278 continue; … … 283 283 image->numCols, image->numRows, readout->mask->numCols, readout->mask->numRows); 284 284 } 285 if (readout-> weight&&286 (readout-> weight->numCols != image->numCols || readout->weight->numRows != image->numRows)) {287 psWarning("Image and weighthave different sizes (%dx%d vs %dx%d)!\n",288 image->numCols, image->numRows, readout-> weight->numCols, readout->weight->numRows);285 if (readout->variance && 286 (readout->variance->numCols != image->numCols || readout->variance->numRows != image->numRows)) { 287 psWarning("Image and variance have different sizes (%dx%d vs %dx%d)!\n", 288 image->numCols, image->numRows, readout->variance->numCols, readout->variance->numRows); 289 289 } 290 290 // New reference … … 355 355 psElemType imageType = 0; // Type of readout images 356 356 psElemType maskType = 0; // Type of readout masks 357 psElemType weightType = 0; // Type of readout weights357 psElemType varianceType = 0; // Type of readout variances 358 358 { 359 359 psListIterator *iter = psListIteratorAlloc(cells, PS_LIST_HEAD, false); // Iterator for cells … … 381 381 maskType = checkTypes(maskType, readout->mask->type.type); 382 382 } 383 if (!hdu-> weights && readout->weight) {384 weightType = checkTypes(weightType, readout->weight->type.type);383 if (!hdu->variances && readout->variance) { 384 varianceType = checkTypes(varianceType, readout->variance->type.type); 385 385 } 386 386 } … … 388 388 psFree(iter); 389 389 } 390 if (numReadouts == 0 || (imageType == 0 && maskType == 0 && weightType == 0)) {390 if (numReadouts == 0 || (imageType == 0 && maskType == 0 && varianceType == 0)) { 391 391 // Nothing from which to create an HDU 392 392 psFree(cells); … … 421 421 } 422 422 } 423 if ( weightType) {424 hdu-> weights = psArrayAlloc(numReadouts);423 if (varianceType) { 424 hdu->variances = psArrayAlloc(numReadouts); 425 425 for (int i = 0; i < numReadouts; i++) { 426 psImage * weight = psImageAlloc(xSize, ySize, weightType);427 psImageInit( weight, 0.0);428 hdu-> weights->data[i] = weight;426 psImage *variance = psImageAlloc(xSize, ySize, varianceType); 427 psImageInit(variance, 0.0); 428 hdu->variances->data[i] = variance; 429 429 } 430 430 } … … 450 450 psArray *hduImages = hdu->images; // Array of images in the HDU 451 451 psArray *hduMasks = hdu->masks; // Array of masks in the HDU 452 psArray *hdu Weights = hdu->weights; // Array of weights in the HDU452 psArray *hduVariances = hdu->variances; // Array of variances in the HDU 453 453 for (int i = 0; i < readouts->n; i++) { 454 454 pmReadout *readout = readouts->data[i]; // The readout of interest … … 467 467 readout->mask = new; 468 468 } 469 if (readout-> weight) {470 psImage *new = pasteImage(hdu Weights->data[i], readout->weight, trimsec);471 psFree(readout-> weight);472 readout-> weight= new;469 if (readout->variance) { 470 psImage *new = pasteImage(hduVariances->data[i], readout->variance, trimsec); 471 psFree(readout->variance); 472 readout->variance = new; 473 473 } 474 474 … … 581 581 return false; 582 582 } 583 if (hdu->images && hdu->masks && hdu-> weights) {583 if (hdu->images && hdu->masks && hdu->variances) { 584 584 // It's already here! 585 585 return true; … … 631 631 return generateForCells(chip); 632 632 } 633 if (hdu->images && hdu->masks && hdu-> weights) {633 if (hdu->images && hdu->masks && hdu->variances) { 634 634 // It's already here! 635 635 return true; … … 680 680 return generateForChips(fpa); 681 681 } 682 if (hdu->images && hdu->masks && hdu-> weights) {682 if (hdu->images && hdu->masks && hdu->variances) { 683 683 // It's already here! 684 684 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
