Changeset 21269
- Timestamp:
- Feb 2, 2009, 2:37:06 PM (17 years ago)
- Location:
- branches/pap_branch_20090128/psModules/src/camera
- Files:
-
- 2 deleted
- 6 edited
-
pmFPARead.c (modified) (6 diffs)
-
pmFPARead.h (modified) (4 diffs)
-
pmFPAWrite.c (modified) (8 diffs)
-
pmHDU.c (modified) (3 diffs)
-
pmHDU.h (modified) (3 diffs)
-
pmHDUCovariances.c (deleted)
-
pmHDUCovariances.h (deleted)
-
pmHDUGenerate.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap_branch_20090128/psModules/src/camera/pmFPARead.c
r21264 r21269 9 9 #include <pslib.h> 10 10 11 #include "pmConfig.h" 12 #include "pmConfigMask.h" 11 13 #include "pmHDU.h" 12 14 #include "pmFPA.h" … … 732 734 return NULL; 733 735 } 734 735 if (type == FPA_READ_TYPE_VARIANCE && hdu->covariances) {736 psArray *covariances = hdu->covariances; // Covariances in HDU737 for (int i = 0; i < covariances->n; i++) {738 pmHDUCovariances *covar = covariances->data[i]; // Covariance information739 740 736 psFree(readout); // Drop reference 741 737 } … … 1143 1139 PS_ASSERT_FITS_NON_NULL(fits, false); 1144 1140 1145 return cellRead(cell, fits, config, FPA_READ_TYPE_VARIANCE); 1141 if (!cellRead(cell, fits, config, FPA_READ_TYPE_VARIANCE)) { 1142 return false; 1143 } 1144 return pmCellReadCovariance(cell, fits); 1146 1145 } 1147 1146 … … 1151 1150 PS_ASSERT_FITS_NON_NULL(fits, false); 1152 1151 1153 return chipRead(chip, fits, config, FPA_READ_TYPE_VARIANCE); 1152 if (!chipRead(chip, fits, config, FPA_READ_TYPE_VARIANCE)) { 1153 return false; 1154 } 1155 return pmChipReadCovariance(chip, fits); 1154 1156 } 1155 1157 … … 1159 1161 PS_ASSERT_FITS_NON_NULL(fits, false); 1160 1162 1161 return fpaRead(fpa, fits, config, FPA_READ_TYPE_VARIANCE); 1163 if (!fpaRead(fpa, fits, config, FPA_READ_TYPE_VARIANCE)) { 1164 return false; 1165 } 1166 return pmFPAReadCovariance(fpa, fits); 1162 1167 } 1163 1168 … … 1285 1290 return numRead; 1286 1291 } 1292 1293 1294 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 1295 // Reading covariance matrices 1296 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 1297 1298 bool pmCellReadCovariance(pmCell *cell, psFits *fits) 1299 { 1300 PS_ASSERT_PTR_NON_NULL(cell, false); 1301 PS_ASSERT_FITS_NON_NULL(fits, false); 1302 1303 const char *chipName = psMetadataLookupStr(NULL, cell->parent->concepts, "CHIP.NAME"); // Name of chip 1304 const char *cellName = psMetadataLookupStr(NULL, cell->concepts, "CELL.NAME"); // Name of cell 1305 psString extname = NULL; // Extension name 1306 psStringAppend(&extname, "COVAR_%s_%s", chipName, cellName); 1307 1308 if (!psFitsMoveExtName(fits, extname)) { 1309 psError(PS_ERR_IO, false, "Unable to move to extension %s\n", extname); 1310 psFree(extname); 1311 return false; 1312 } 1313 psFree(extname); 1314 1315 psMetadata *header = psFitsReadHeader(NULL, fits); // The FITS header 1316 if (!header) { 1317 psError(PS_ERR_IO, false, "Unable to read header for extension %s\n", extname); 1318 psFree(header); 1319 return false; 1320 } 1321 1322 bool mdok; // Status of MD lookup 1323 int x0 = psMetadataLookupS32(&mdok, header, "COVARIANCE.CENTRE.X"); // Centre of matrix in x 1324 if (!mdok) { 1325 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Unable to read covariance centre"); 1326 psFree(header); 1327 return false; 1328 } 1329 int y0 = psMetadataLookupS32(&mdok, header, "COVARIANCE.CENTRE.Y"); // Centre of matrix in y 1330 if (!mdok) { 1331 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Unable to read covariance centre"); 1332 psFree(header); 1333 return false; 1334 } 1335 psFree(header); 1336 1337 psArray *images = psFitsReadImageCube(fits, psRegionSet(0,0,0,0)); // Covariance matrices 1338 if (!images) { 1339 psError(PS_ERR_IO, false, "Unable to read covariance matrices for chip %s, cell %s", 1340 chipName, cellName); 1341 return false; 1342 } 1343 1344 psArray *readouts = cell->readouts; // Readouts of cell 1345 if (images->n != readouts->n) { 1346 psError(PS_ERR_BAD_PARAMETER_SIZE, true, 1347 "Number of covariance matrices (%ld) doesn't match number of readouts (%ld)", 1348 images->n, readouts->n); 1349 psFree(images); 1350 return false; 1351 } 1352 1353 for (int i = 0; i < readouts->n; i++) { 1354 pmReadout *ro = readouts->data[i]; // Readout of interest 1355 psImage *image = images->data[i]; // Image of interest 1356 if (ro->covariance) { 1357 psWarning("Clobbering extant covariance matrix in chip %s, cell %s, readout %d", 1358 chipName, cellName, i); 1359 psFree(ro->covariance); 1360 } 1361 ro->covariance = psKernelAllocFromImage(image, x0, y0); 1362 } 1363 psFree(images); 1364 1365 return true; 1366 } 1367 1368 1369 bool pmChipReadCovariance(pmChip *chip, psFits *fits) 1370 { 1371 PS_ASSERT_PTR_NON_NULL(chip, false); 1372 PS_ASSERT_FITS_NON_NULL(fits, false); 1373 1374 psArray *cells = chip->cells; // Array of cells 1375 for (int i = 0; i < cells->n; i++) { 1376 pmCell *cell = cells->data[i]; // Cell of interest 1377 if (!pmCellReadCovariance(cell, fits)) { 1378 return false; 1379 } 1380 } 1381 1382 return true; 1383 } 1384 1385 1386 bool pmFPAReadCovariance(pmFPA *fpa, psFits *fits) 1387 { 1388 PS_ASSERT_PTR_NON_NULL(fpa, false); 1389 PS_ASSERT_FITS_NON_NULL(fits, false); 1390 1391 psArray *chips = fpa->chips; // Array of chips 1392 for (int i = 0; i < chips->n; i++) { 1393 pmChip *chip = chips->data[i]; // Chip of interest 1394 if (!pmChipReadCovariance(chip, fits)) { 1395 return false; 1396 } 1397 } 1398 1399 return true; 1400 } -
branches/pap_branch_20090128/psModules/src/camera/pmFPARead.h
r21211 r21269 4 4 * @author Paul Price, IfA 5 5 * 6 * @version $Revision: 1.15.44. 1$ $Name: not supported by cvs2svn $7 * @date $Date: 2009-0 1-29 00:33:51$6 * @version $Revision: 1.15.44.2 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2009-02-03 00:37:06 $ 8 8 * Copyright 2005-2006 Institute for Astronomy, University of Hawaii 9 9 */ … … 226 226 /// also read and included in the cell analysis metadata under "name.HEADER". 227 227 int pmCellReadTable(pmCell *cell, ///< Cell for which to read table 228 psFits *fits, ///< FITS file from which t he table228 psFits *fits, ///< FITS file from which to read the table 229 229 const char *name ///< Specifies the extension name, and target in the analysis metadata 230 230 ); … … 233 233 /// 234 234 /// Iterates over component cells, calling pmCellReadTable. 235 int pmChipReadTable(pmChip *chip, ///< C ellfor which to read table236 psFits *fits, ///< FITS file from which t he table235 int pmChipReadTable(pmChip *chip, ///< Chip for which to read table 236 psFits *fits, ///< FITS file from which to read the table 237 237 const char *name ///< Specifies the extension name, and target in the analysis metadata 238 238 ); … … 241 241 /// 242 242 /// Iterates over component chips, calling pmChipReadTable. 243 int pmFPAReadTable(pmFPA *fpa, ///< Cellfor which to read table244 psFits *fits, ///< FITS file from which t he table243 int pmFPAReadTable(pmFPA *fpa, ///< FPA for which to read table 244 psFits *fits, ///< FITS file from which to read the table 245 245 const char *name ///< Specifies the extension name, and target in the analysis metadata 246 246 ); 247 248 /// Read covariance matrices for a cell 249 bool pmCellReadCovariance(pmCell *cell, ///< Cell for which to read covariance matrices 250 psFits *fits ///< FITS file from which to read 251 ); 252 253 /// Read covariance matrices for a chip 254 bool pmChipReadCovariance(pmChip *chip, ///< Chip for which to read covariance matrices 255 psFits *fits ///< FITS file from which to read 256 ); 257 258 /// Read covariance matrices for a cell 259 bool pmFPAReadCovariance(pmFPA *fpa, ///< FPA for which to read covariance matrices 260 psFits *fits ///< FITS file from which to read 261 ); 262 263 264 247 265 /// @} 248 266 #endif -
branches/pap_branch_20090128/psModules/src/camera/pmFPAWrite.c
r21264 r21269 9 9 10 10 #include "pmConfig.h" 11 #include "pmConfigMask.h" 11 12 #include "pmHDU.h" 12 13 #include "pmFPA.h" … … 74 75 } 75 76 76 77 77 // Indicate whether a covariance matrix is defined 78 static bool readoutSearchCovariances(pmReadout *ro) 79 { 80 return ro->covariance ? true : false; 81 } 82 83 // Search for a covariance matrix 84 #define SEARCH_COVARIANCES(NAME, PARENT, CHILD, CHILDREN, TESTFUNC) \ 85 static bool NAME(PARENT *parent) \ 86 { \ 87 if (!parent || !parent->CHILDREN) { \ 88 return false; \ 89 } \ 90 psArray *children = parent->CHILDREN; /* Array of children */ \ 91 for (int i = 0; i < children->n; i++) { \ 92 CHILD *child = children->data[i]; /* Child of interest */ \ 93 if (child && TESTFUNC(child)) { \ 94 return true; \ 95 } \ 96 } \ 97 return false; \ 98 } 99 100 SEARCH_COVARIANCES(cellSearchCovariances, pmCell, pmReadout, readouts, readoutSearchCovariances); 101 SEARCH_COVARIANCES(chipSearchCovariances, pmChip, pmCell, cells, cellSearchCovariances); 102 SEARCH_COVARIANCES(fpaSearchCovariances, pmFPA, pmChip, chips, chipSearchCovariances); 78 103 79 104 // Some type-specific additions to the header … … 81 106 pmChip *chip, // Chip of interest, or NULL 82 107 pmCell *cell, // Cell of interest, or NULL 83 fpaWriteType type // Type to write 84 ) 108 fpaWriteType type, // Type to write 109 pmConfig *config // Configuration 110 ) 85 111 { 86 112 switch (type) { … … 94 120 } 95 121 case FPA_WRITE_TYPE_VARIANCE: { 122 bool covar = false; // Are covariances present? 123 if ((cell && cellSearchCovariances(cell)) || 124 (!cell && ((chip && chipSearchCovariances(chip)) || 125 (!chip && fpa && fpaSearchCovariances)))) { 126 covar = true; 127 } 128 96 129 pmHDU *hdu = pmHDUGetLowest(fpa, chip, cell); // Header being written 97 130 psMetadataAddBool(hdu->header, PS_LIST_TAIL, PM_HDU_COVARIANCE_KEYWORD, PS_META_REPLACE, 131 "Is a covariance matrix present?", covar); 132 break; 133 } 134 default: 135 break; 136 } 137 138 return true; 139 } 98 140 99 141 … … 137 179 return false; 138 180 } 139 140 181 if (!writeUpdateHeader(NULL, NULL, cell, type, config)) { 182 psError(PS_ERR_UNKNOWN, false, "Unable to update header for writing"); 183 return false; 184 } 141 185 if (!appropriateWriteFunc(hdu, fits, config, type)) { 142 186 psError(PS_ERR_IO, false, "Unable to write HDU for cell.\n"); … … 189 233 return false; 190 234 } 235 236 if (!writeUpdateHeader(NULL, chip, NULL, type, config)) { 237 psError(PS_ERR_UNKNOWN, false, "Unable to update header for writing"); 238 return false; 239 } 240 191 241 if (!appropriateWriteFunc(hdu, fits, config, type)) { 192 242 psError(PS_ERR_IO, false, "Unable to write HDU for chip.\n"); … … 253 303 return false; 254 304 } 305 if (!writeUpdateHeader(fpa, NULL, NULL, type, config)) { 306 psError(PS_ERR_UNKNOWN, false, "Unable to update header for writing"); 307 return false; 308 } 255 309 if (!appropriateWriteFunc(hdu, fits, config, type)) { 256 310 psError(PS_ERR_IO, false, "Unable to write HDU for FPA.\n"); … … 535 589 return numWrite; 536 590 } 591 592 bool pmCellWriteCovariance(psFits *fits, const pmCell *cell) 593 { 594 PS_ASSERT_PTR_NON_NULL(cell, false); 595 PS_ASSERT_PTR_NON_NULL(fits, false); 596 597 int numCovar = 0; 598 psArray *readouts = cell->readouts; // Array of readouts 599 for (int i = 0; i < readouts->n; i++) { 600 pmReadout *readout = readouts->data[i]; // The readout of interest 601 if (readout && readout->covariance) { 602 numCovar++; 603 } 604 } 605 if (numCovar == 0) { 606 return true; 607 } 608 if (numCovar != readouts->n) { 609 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 610 "Number of covariances (%d) doesn't match number of readouts (%ld)", 611 numCovar, readouts->n); 612 return false; 613 } 614 615 // Check size of covariances 616 int xMinCovar = INT_MAX, xMaxCovar = INT_MIN, yMinCovar = INT_MAX, yMaxCovar = INT_MIN; // Size 617 for (int i = 0; i < readouts->n; i++) { 618 pmReadout *readout = readouts->data[i]; // The readout of interest 619 psAssert(readout, "Should be defined."); 620 psKernel *covar = readout->covariance; // Covariance matrix 621 psAssert(covar, "Should be defined."); 622 xMinCovar = PS_MIN(xMinCovar, covar->xMin); 623 xMaxCovar = PS_MAX(xMaxCovar, covar->xMax); 624 yMinCovar = PS_MIN(yMinCovar, covar->yMin); 625 yMaxCovar = PS_MAX(yMaxCovar, covar->yMax); 626 } 627 628 // Correct covariances to common size 629 psArray *images = psArrayAlloc(numCovar); // Array of images 630 for (int i = 0; i < readouts->n; i++) { 631 pmReadout *readout = readouts->data[i]; // The readout of interest 632 psAssert(readout, "Should be defined."); 633 psKernel *covar = readout->covariance; // Covariance matrix 634 psAssert(covar, "Should be defined."); 635 int xMin = covar->xMin, xMax = covar->xMax, yMin = covar->yMin, yMax = covar->yMax;// Size 636 if (xMin == xMinCovar && xMax == xMaxCovar && yMin == yMinCovar && yMax == yMaxCovar) { 637 images->data[i] = psMemIncrRefCounter(covar->image); 638 } else { 639 psImage *new = psImageAlloc(xMaxCovar - xMinCovar + 1, yMaxCovar - yMinCovar + 1, PS_TYPE_F32); 640 psImageInit(new, 0); 641 psImageOverlaySection(new, covar->image, xMinCovar - xMin, yMinCovar - yMin, "="); 642 images->data[i] = new; 643 } 644 } 645 646 // Determine extension name 647 const char *chipName = psMetadataLookupStr(NULL, cell->parent->concepts, "CHIP.NAME"); // Name of chip 648 const char *cellName = psMetadataLookupStr(NULL, cell->concepts, "CELL.NAME"); // Name of cell 649 psString extname = NULL; // Extension name 650 psStringAppend(&extname, "COVAR_%s_%s", chipName, cellName); 651 652 // Generate header 653 pmHDU *hdu = pmHDUFromCell(cell); // HDU for cell 654 psMetadata *header = psMetadataCopy(NULL, hdu->header); // Header to write 655 psMetadataAddS32(header, PS_LIST_TAIL, "COVARIANCE.CENTRE.X", PS_META_REPLACE, 656 "Centre of covariance matrix in x", -xMinCovar); 657 psMetadataAddS32(header, PS_LIST_TAIL, "COVARIANCE.CENTRE.Y", PS_META_REPLACE, 658 "Centre of covariance matrix in y", -yMinCovar); 659 660 // Write images 661 if (!psFitsWriteImageCube(fits, header, images, extname)) { 662 psError(PS_ERR_UNKNOWN, false, "Unable to write covariances from chip %s, cell %s to extension %s", 663 chipName, cellName, extname); 664 psFree(extname); 665 psFree(header); 666 psFree(images); 667 return 0; 668 } 669 psFree(extname); 670 psFree(header); 671 psFree(images); 672 673 return true; 674 } 675 676 677 bool pmChipWriteCovariance(psFits *fits, const pmChip *chip) 678 { 679 PS_ASSERT_PTR_NON_NULL(chip, false); 680 PS_ASSERT_PTR_NON_NULL(fits, false); 681 682 psArray *cells = chip->cells; // Array of cells 683 for (int i = 0; i < cells->n; i++) { 684 pmCell *cell = cells->data[i]; // Cell of interest 685 if (!pmCellWriteCovariance(fits, cell)) { 686 return false; 687 } 688 } 689 690 return true; 691 } 692 693 694 bool pmFPAWriteCovariance(psFits *fits, const pmFPA *fpa) 695 { 696 PS_ASSERT_PTR_NON_NULL(fpa, false); 697 PS_ASSERT_PTR_NON_NULL(fits, false); 698 699 psArray *chips = fpa->chips; // Array of chips 700 for (int i = 0; i < chips->n; i++) { 701 pmChip *chip = chips->data[i]; // Chip of interest 702 if (!pmChipWriteCovariance(fits, chip)) { 703 return false; 704 } 705 } 706 707 return true; 708 } -
branches/pap_branch_20090128/psModules/src/camera/pmHDU.c
r21264 r21269 12 12 #include "pmHDU.h" 13 13 #include "pmFPA.h" 14 15 #define COVARIANCE_INDICATOR "PS_COVAR" // FITS keyword to indicate if covariance matrices are present16 14 17 15 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// … … 162 160 PS_ASSERT_PTR_NON_NULL(fits, false); 163 161 164 if (!hduRead(hdu, &hdu->variances, fits)) { 165 return false; 166 } 167 168 return true; 162 return hduRead(hdu, &hdu->variances, fits); 169 163 } 170 164 … … 246 240 PS_ASSERT_PTR_NON_NULL(fits, false); 247 241 248 pmHDUCovariancesWriteHeader(hdu);249 250 242 psImageMaskType maskVal = pmConfigMaskGet("MASK.VALUE", config); // Value to mask 251 if (!hduWrite(hdu, hdu->variances, hdu->masks, maskVal, fits)) { 252 return false; 253 } 254 pmHDUCovarianceClearHeader(hdu); 255 256 if (!pmHDUCovarianceWrite(hdu, fits)) { 257 psError(PS_ERR_UNKNOWN, false, "Unable to write covariance"); 258 return false; 259 } 260 261 return true; 262 } 243 return hduWrite(hdu, hdu->variances, hdu->masks, maskVal, fits); 244 } -
branches/pap_branch_20090128/psModules/src/camera/pmHDU.h
r21264 r21269 4 4 * @author Paul Price, IfA 5 5 * 6 * @version $Revision: 1.9.22. 2$ $Name: not supported by cvs2svn $7 * @date $Date: 2009-02-0 2 18:05:38$6 * @version $Revision: 1.9.22.3 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2009-02-03 00:37:06 $ 8 8 * Copyright 2005-2006 Institute for Astronomy, University of Hawaii 9 9 */ … … 17 17 /// @addtogroup Camera Camera Layout 18 18 /// @{ 19 20 #define PM_HDU_COVARIANCE_KEYWORD "PS_COVAR" // FITS keyword to indicate presence of a covariance matrix 19 21 20 22 /// An instance of the FITS Header Data Unit … … 30 32 psArray *variances; ///< Variance in the pixel data, or NULL 31 33 psArray *masks; ///< Mask for the pixel data, or NULL 32 psArray *covariances; ///< Covariance matrices (pmHDUCovariance), or NULL33 34 } pmHDU; 34 35 -
branches/pap_branch_20090128/psModules/src/camera/pmHDUGenerate.c
r21264 r21269 356 356 psElemType maskType = 0; // Type of readout masks 357 357 psElemType varianceType = 0; // Type of readout variances 358 psElemType covarianceType = 0; // Type of readout covariances359 358 { 360 359 psListIterator *iter = psListIteratorAlloc(cells, PS_LIST_HEAD, false); // Iterator for cells … … 385 384 varianceType = checkTypes(varianceType, readout->variance->type.type); 386 385 } 387 if (!hdu->covariances && readout->covariance) {388 covarianceType = checkTypes(covarianceType, PS_TYPE_F32);389 }390 386 } 391 387 } 392 388 psFree(iter); 393 389 } 394 if (numReadouts == 0 || (imageType == 0 && maskType == 0 && varianceType == 0 && covarianceType == 0)) {390 if (numReadouts == 0 || (imageType == 0 && maskType == 0 && varianceType == 0)) { 395 391 // Nothing from which to create an HDU 396 392 psFree(cells); … … 432 428 hdu->variances->data[i] = variance; 433 429 } 434 }435 if (covarianceType) {436 hdu->covariances = psHashAlloc(psListLength(cells));437 430 } 438 431 … … 456 449 psArray *readouts = cell->readouts; // Array of readouts 457 450 458 // Check size of covariances459 int xMinCovar = INT_MAX, xMaxCovar = INT_MIN, yMinCovar = INT_MAX, yMaxCovar = INT_MIN; // Size460 if (covarianceType) {461 for (int i = 0; i < readouts->n; i++) {462 pmReadout *readout = readouts->data[i]; // The readout of interest463 if (!readout) {464 continue;465 }466 psKernel *covar = readout->covariance; // Covariance matrix467 xMinCovar = PS_MIN(xMinCovar, covar->xMin);468 xMaxCovar = PS_MAX(xMaxCovar, covar->xMax);469 yMinCovar = PS_MIN(yMinCovar, covar->yMin);470 yMaxCovar = PS_MAX(yMaxCovar, covar->yMax);471 }472 }473 474 451 psArray *hduImages = hdu->images; // Array of images in the HDU 475 452 psArray *hduMasks = hdu->masks; // Array of masks in the HDU 476 453 psArray *hduVariances = hdu->variances; // Array of variances in the HDU 477 psArray *covariances = (covarianceType ? psArrayAlloc(readouts->n) : NULL; // Covariance images478 454 for (int i = 0; i < readouts->n; i++) { 479 455 pmReadout *readout = readouts->data[i]; // The readout of interest … … 496 472 psFree(readout->variance); 497 473 readout->variance = new; 498 }499 if (readout->covariance) {500 psKernel *covar = readout->covariance; // Covariance matrix501 int xMin = covar->xMin, xMax = covar->xMax, yMin = covar->yMin, yMax = covar->yMax;// Size502 if (xMin == xMinCovar && xMax == xMaxCovar && yMin == yMinCovar && yMax == yMaxCovar) {503 variances->data[i] = psMemIncrRefCounter(readout->covariance);504 } else {505 psKernel *new = psKernelAlloc(xMinCovar, xMaxCovar, yMinCovar, yMaxCovar);// New covar506 psImageInit(covar->image, 0);507 psImageOverlaySection(new->image, covar->image,508 xMinCovar - xMin, yMinCovar - yMin, "=");509 variances->data[i] = new;510 }511 474 } 512 475 … … 533 496 } 534 497 psFree(biassecsIter); 535 536 if (covariances) {537 const char *cellName = psMetadataLookupStr(NULL, cell->concepts, "CELL.NAME"); // Name of cell538 pmChip *chip = cell->parent; // Parent chip539 const char *chipName = psMetadataLookupStr(NULL, chip->concepts, "CHIP.NAME"); // Name of chip540 if (!cellName || !chipName) {541 psError(PS_ERR_UNKNOWN, false, "Unable to find cell or chip name.");542 return false;543 }544 psString name = NULL; // Name for covariance extension545 psStringAppend(&name, "COVAR_%s_%s", chipName, cellName);546 if (psHashLookup(hdu->covariances, name)) {547 psHashRemove(hash, name);548 }549 psHashAdd(hdu->covariances, name, covariance);550 psFree(name);551 }552 498 } // Iterating over cells within the HDU 553 499 psFree(iter); … … 636 582 return false; 637 583 } 638 if (hdu->images && hdu->masks && hdu->variances && hdu->covariances) {584 if (hdu->images && hdu->masks && hdu->variances) { 639 585 // It's already here! 640 586 return true; … … 686 632 return generateForCells(chip); 687 633 } 688 if (hdu->images && hdu->masks && hdu->variances && hdu->covariances) {634 if (hdu->images && hdu->masks && hdu->variances) { 689 635 // It's already here! 690 636 return true; … … 735 681 return generateForChips(fpa); 736 682 } 737 if (hdu->images && hdu->masks && hdu->variances && hdu->covariances) {683 if (hdu->images && hdu->masks && hdu->variances) { 738 684 // It's already here! 739 685 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
