- Timestamp:
- Feb 2, 2009, 8:05:38 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/pap_branch_20090128/psModules/src/camera/pmFPARead.c
r21211 r21264 28 28 FPA_READ_TYPE_IMAGE, // Read image 29 29 FPA_READ_TYPE_MASK, // Read mask 30 FPA_READ_TYPE_VARIANCE, // Read variance map30 FPA_READ_TYPE_VARIANCE, // Read variance map 31 31 FPA_READ_TYPE_HEADER // Read header 32 32 } fpaReadType; … … 515 515 } 516 516 517 // XXX for IMAGE, we need the CELL.BAD value, but for MASK, we need the BAD mask value 518 519 float bad = 0; 520 if (type == FPA_READ_TYPE_MASK) { 521 bad = 1.0; 522 } else { 523 bad = psMetadataLookupF32(&mdok, cell->concepts, "CELL.BAD"); // Bad level 517 // Need to set the invalid (unread) pixels appropriately, and to read the mask bits 518 float bad = 0; // Bad level 519 switch (type) { 520 case FPA_READ_TYPE_MASK: { 521 pmHDU *phu = pmHDUGetHighest(cell->parent->parent, cell->parent, cell); // Primary header 522 if (!pmConfigMaskReadHeader(config, phu->header)) { 523 psError(PS_ERR_IO, false, "Unable to determine mask bits"); 524 return false; 525 } 526 bad = pmConfigMaskGet("BAD", config); 527 break; 528 } 529 case FPA_READ_TYPE_IMAGE: 530 case FPA_READ_TYPE_VARIANCE: 531 bad = psMetadataLookupF32(&mdok, cell->concepts, "CELL.BAD"); 532 break; 533 default: 534 psAbort("Unrecognised type: %x", type); 524 535 } 525 536 … … 721 732 return NULL; 722 733 } 734 735 if (type == FPA_READ_TYPE_VARIANCE && hdu->covariances) { 736 psArray *covariances = hdu->covariances; // Covariances in HDU 737 for (int i = 0; i < covariances->n; i++) { 738 pmHDUCovariances *covar = covariances->data[i]; // Covariance information 739 723 740 psFree(readout); // Drop reference 724 741 } … … 852 869 float bad = psMetadataLookupF32(&mdok, cell->concepts, "CELL.BAD"); // Bad level 853 870 if (!mdok) { 854 ps LogMsg(__func__, PS_LOG_WARN,"CELL.BAD is not set --- assuming zero.\n");871 psWarning("CELL.BAD is not set --- assuming zero.\n"); 855 872 bad = 0.0; 856 873 }
Note:
See TracChangeset
for help on using the changeset viewer.
