- 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/pmFPARead.c
r21183 r21211 28 28 FPA_READ_TYPE_IMAGE, // Read image 29 29 FPA_READ_TYPE_MASK, // Read mask 30 FPA_READ_TYPE_ WEIGHT, // Read weightmap30 FPA_READ_TYPE_VARIANCE, // Read variance map 31 31 FPA_READ_TYPE_HEADER // Read header 32 32 } fpaReadType; … … 54 54 case FPA_READ_TYPE_MASK: 55 55 return readout->thisMaskScan; 56 case FPA_READ_TYPE_ WEIGHT:57 return readout->this WeightScan;56 case FPA_READ_TYPE_VARIANCE: 57 return readout->thisVarianceScan; 58 58 default: 59 59 psAbort("Unknown read type: %x\n", type); … … 74 74 readout->thisMaskScan = thisScan; 75 75 return readout->lastMaskScan; 76 case FPA_READ_TYPE_ WEIGHT:77 readout->this WeightScan = thisScan;78 return readout->last WeightScan;76 case FPA_READ_TYPE_VARIANCE: 77 readout->thisVarianceScan = thisScan; 78 return readout->lastVarianceScan; 79 79 default: 80 80 psAbort("Unknown read type: %x\n", type); … … 93 93 case FPA_READ_TYPE_MASK: 94 94 return readout->lastMaskScan; 95 case FPA_READ_TYPE_ WEIGHT:96 return readout->last WeightScan;95 case FPA_READ_TYPE_VARIANCE: 96 return readout->lastVarianceScan; 97 97 default: 98 98 psAbort("Unknown read type: %x\n", type); … … 113 113 readout->lastMaskScan = lastScan; 114 114 return readout->lastMaskScan; 115 case FPA_READ_TYPE_ WEIGHT:116 readout->last WeightScan = lastScan;117 return readout->last WeightScan;115 case FPA_READ_TYPE_VARIANCE: 116 readout->lastVarianceScan = lastScan; 117 return readout->lastVarianceScan; 118 118 default: 119 119 psAbort("Unknown read type: %x\n", type); … … 132 132 case FPA_READ_TYPE_MASK: 133 133 return &readout->mask; 134 case FPA_READ_TYPE_ WEIGHT:135 return &readout-> weight;134 case FPA_READ_TYPE_VARIANCE: 135 return &readout->variance; 136 136 default: 137 137 psAbort("Unknown read type: %x\n", type); … … 350 350 *target = psImageSubset(image, region); 351 351 352 // Get the list of overscans: only for IMAGE types (no overscan for MASK and WEIGHT)352 // Get the list of overscans: only for IMAGE types (no overscan for MASK and VARIANCE) 353 353 if (type == FPA_READ_TYPE_IMAGE) { 354 354 if (readout->bias->n != 0) { … … 582 582 *image = readoutReadComponent(*image, fits, trimsec, readdir, thisScan, lastScan, z, bad, pixelTypes[type]); 583 583 584 // Read overscans only for "image" type --- weights and masks shouldn't record overscans584 // Read overscans only for "image" type --- variances and masks shouldn't record overscans 585 585 if (type == FPA_READ_TYPE_IMAGE) { 586 586 // Blow away existing data … … 608 608 } 609 609 610 // Read into an cell; this is the engine for pmCellRead, pmCellReadMask, pmCellRead Weight610 // Read into an cell; this is the engine for pmCellRead, pmCellReadMask, pmCellReadVariance 611 611 // Does most of the work for the reading --- reads the HDU, and portions the HDU into readouts. 612 612 static bool cellRead(pmCell *cell, // Cell into which to read … … 640 640 dataPointer = hdu->masks; 641 641 break; 642 case FPA_READ_TYPE_ WEIGHT:643 hduReadFunc = pmHDURead Weight;644 dataPointer = hdu-> weights;642 case FPA_READ_TYPE_VARIANCE: 643 hduReadFunc = pmHDUReadVariance; 644 dataPointer = hdu->variances; 645 645 break; 646 646 default: … … 680 680 imageArray = hdu->masks; 681 681 break; 682 case FPA_READ_TYPE_ WEIGHT:683 imageArray = hdu-> weights;682 case FPA_READ_TYPE_VARIANCE: 683 imageArray = hdu->variances; 684 684 break; 685 685 default: … … 729 729 730 730 731 // Read into an chip; this is the engine for pmChipRead, pmChipReadMask, pmChipRead Weight731 // Read into an chip; this is the engine for pmChipRead, pmChipReadMask, pmChipReadVariance 732 732 // Iterates over component cells, reading each 733 733 static bool chipRead(pmChip *chip, // Chip into which to read … … 760 760 761 761 762 // Read into an FPA; this is the engine for pmFPARead, pmFPAReadMask, pmFPARead Weight762 // Read into an FPA; this is the engine for pmFPARead, pmFPAReadMask, pmFPAReadVariance 763 763 // Iterates over component chips, reading each 764 764 static bool fpaRead(pmFPA *fpa, // FPA into which to read … … 1091 1091 1092 1092 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 1093 // Reading the weightmap1094 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 1095 1096 bool pmReadoutMore Weight(pmReadout *readout, psFits *fits, int z, int numScans, pmConfig *config)1093 // Reading the variance map 1094 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 1095 1096 bool pmReadoutMoreVariance(pmReadout *readout, psFits *fits, int z, int numScans, pmConfig *config) 1097 1097 { 1098 1098 PS_ASSERT_PTR_NON_NULL(readout, false); 1099 1099 PS_ASSERT_FITS_NON_NULL(fits, false); 1100 1100 1101 return readoutMore(readout, fits, z, numScans, FPA_READ_TYPE_ WEIGHT, config);1102 } 1103 1104 bool pmReadoutReadChunk Weight(pmReadout *readout, psFits *fits, int z, int numScans, int overlap,1101 return readoutMore(readout, fits, z, numScans, FPA_READ_TYPE_VARIANCE, config); 1102 } 1103 1104 bool pmReadoutReadChunkVariance(pmReadout *readout, psFits *fits, int z, int numScans, int overlap, 1105 1105 pmConfig *config) 1106 1106 { … … 1110 1110 PS_ASSERT_INT_NONNEGATIVE(numScans, false); 1111 1111 1112 return readoutReadChunk(readout, fits, z, numScans, overlap, FPA_READ_TYPE_ WEIGHT, config);1113 } 1114 1115 bool pmReadoutRead Weight(pmReadout *readout, psFits *fits, int z, pmConfig *config)1112 return readoutReadChunk(readout, fits, z, numScans, overlap, FPA_READ_TYPE_VARIANCE, config); 1113 } 1114 1115 bool pmReadoutReadVariance(pmReadout *readout, psFits *fits, int z, pmConfig *config) 1116 1116 { 1117 1117 PS_ASSERT_PTR_NON_NULL(readout, false); 1118 1118 PS_ASSERT_FITS_NON_NULL(fits, false); 1119 1119 1120 return readoutReadChunk(readout, fits, z, 0, 0, FPA_READ_TYPE_ WEIGHT, config);1121 } 1122 1123 bool pmCellRead Weight(pmCell *cell, psFits *fits, pmConfig *config)1120 return readoutReadChunk(readout, fits, z, 0, 0, FPA_READ_TYPE_VARIANCE, config); 1121 } 1122 1123 bool pmCellReadVariance(pmCell *cell, psFits *fits, pmConfig *config) 1124 1124 { 1125 1125 PS_ASSERT_PTR_NON_NULL(cell, false); 1126 1126 PS_ASSERT_FITS_NON_NULL(fits, false); 1127 1127 1128 return cellRead(cell, fits, config, FPA_READ_TYPE_ WEIGHT);1129 } 1130 1131 bool pmChipRead Weight(pmChip *chip, psFits *fits, pmConfig *config)1128 return cellRead(cell, fits, config, FPA_READ_TYPE_VARIANCE); 1129 } 1130 1131 bool pmChipReadVariance(pmChip *chip, psFits *fits, pmConfig *config) 1132 1132 { 1133 1133 PS_ASSERT_PTR_NON_NULL(chip, false); 1134 1134 PS_ASSERT_FITS_NON_NULL(fits, false); 1135 1135 1136 return chipRead(chip, fits, config, FPA_READ_TYPE_ WEIGHT);1137 } 1138 1139 bool pmFPARead Weight(pmFPA *fpa, psFits *fits, pmConfig *config)1136 return chipRead(chip, fits, config, FPA_READ_TYPE_VARIANCE); 1137 } 1138 1139 bool pmFPAReadVariance(pmFPA *fpa, psFits *fits, pmConfig *config) 1140 1140 { 1141 1141 PS_ASSERT_PTR_NON_NULL(fpa, false); 1142 1142 PS_ASSERT_FITS_NON_NULL(fits, false); 1143 1143 1144 return fpaRead(fpa, fits, config, FPA_READ_TYPE_ WEIGHT);1144 return fpaRead(fpa, fits, config, FPA_READ_TYPE_VARIANCE); 1145 1145 } 1146 1146
Note:
See TracChangeset
for help on using the changeset viewer.
