Changeset 21090 for branches/eam_branch_20081230/ppStack/src/ppStackLoop.c
- Timestamp:
- Jan 7, 2009, 6:43:53 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20081230/ppStack/src/ppStackLoop.c
r20997 r21090 401 401 int numGood = 0; // Number of good frames 402 402 int numCols = 0, numRows = 0; // Size of image 403 psVector *inputMask = psVectorAlloc(num, PS_TYPE_ U8); // Mask for inputs403 psVector *inputMask = psVectorAlloc(num, PS_TYPE_VECTOR_MASK); // Mask for inputs 404 404 psVectorInit(inputMask, 0); 405 405 psVector *matchChi2 = psVectorAlloc(num, PS_TYPE_F32); // chi^2 for stamps when matching … … 445 445 sourceLists->data[i], targetPSF, rng, config)) { 446 446 psErrorStackPrint(stderr, "Unable to match image %d --- ignoring.", i); 447 inputMask->data. U8[i] = PPSTACK_MASK_MATCH;447 inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = PPSTACK_MASK_MATCH; 448 448 psErrorClear(); 449 449 continue; … … 501 501 psVector *values = psVectorAllocEmpty(num, PS_TYPE_F32); // Values to sort 502 502 for (int i = 0; i < num; i++) { 503 if (inputMask->data.PS_TYPE_ MASK_DATA[i] & PPSTACK_MASK_ALL) {503 if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] & PPSTACK_MASK_ALL) { 504 504 continue; 505 505 } … … 534 534 numGood = 0; // Number of good images 535 535 for (int i = 0; i < num; i++) { 536 if (inputMask->data.PS_TYPE_MASK_DATA[i] & PPSTACK_MASK_ALL) {536 if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] & PPSTACK_MASK_ALL) { 537 537 continue; 538 538 } 539 539 if (matchChi2->data.F32[i] > thresh) { 540 540 numRej++; 541 inputMask->data.PS_TYPE_ MASK_DATA[i] |= PPSTACK_MASK_CHI2;541 inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] |= PPSTACK_MASK_CHI2; 542 542 psLogMsg("ppStack", PS_LOG_INFO, "Rejecting image %d because of large matching chi^2: %f", 543 543 i, matchChi2->data.F32[i]); … … 612 612 613 613 psString maskBadStr = psMetadataLookupStr(NULL, recipe, "MASK.BAD"); // Name of bits to mask for bad 614 ps MaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels614 psImageMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels 615 615 if (!pmReadoutStackDefineOutput(outRO, col0, row0, numCols, numRows, true, true, maskBad)) { 616 616 psError(PS_ERR_UNKNOWN, false, "Unable to prepare output."); … … 714 714 inspect = psArrayAlloc(num); 715 715 for (int i = 0; i < num; i++) { 716 if (inputMask->data. U8[i]) {716 if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) { 717 717 continue; 718 718 } … … 725 725 psArray *results = job->results; // Results of job 726 726 for (int i = 0; i < num; i++) { 727 if (inputMask->data. U8[i]) {727 if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) { 728 728 continue; 729 729 } … … 751 751 // Count images rejected out of hand 752 752 for (int i = 0; i < num; i++) { 753 if (inputMask->data. U8[i]) {753 if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) { 754 754 numRejected++; 755 755 } … … 757 757 758 758 for (int i = 0; i < num; i++) { 759 if (inputMask->data. U8[i]) {759 if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) { 760 760 continue; 761 761 } … … 802 802 // Reject bad pixels 803 803 for (int i = 0; i < num; i++) { 804 if (inputMask->data. U8[i]) {804 if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) { 805 805 continue; 806 806 } … … 845 845 psWarning("Rejection on image %d didn't work --- reject entire image.", i); 846 846 numRejected++; 847 inputMask->data. U8[i] = PPSTACK_MASK_REJECT;847 inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = PPSTACK_MASK_REJECT; 848 848 } else { 849 849 float frac = reject->n / (float)(numCols * numRows); // Pixel fraction … … 856 856 // reject == NULL means reject image completely 857 857 reject = NULL; 858 inputMask->data. U8[i] = PPSTACK_MASK_BAD;858 inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = PPSTACK_MASK_BAD; 859 859 numRejected++; 860 860 } … … 968 968 { 969 969 psString maskBadStr = psMetadataLookupStr(NULL, recipe, "MASK.BAD"); // Name of bits for bad 970 ps MaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels970 psImageMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels 971 971 if (!pmReadoutMaskApply(outRO, maskBad)) { 972 972 psWarning("Unable to apply mask"); … … 979 979 float totExposure = 0.0; // Total exposure time 980 980 for (int i = 0; i < num; i++) { 981 if (inputMask->data. U8[i]) {981 if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) { 982 982 continue; 983 983 } … … 1044 1044 pmCell *cell1 = pmFPAfileThisCell(config->files, view, "PPSTACK.OUTPUT.JPEG1"); 1045 1045 pmCell *cell2 = pmFPAfileThisCell(config->files, view, "PPSTACK.OUTPUT.JPEG2"); 1046 ps MaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask1046 psImageMaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask 1047 1047 1048 1048 pmReadout *ro1 = pmReadoutAlloc(cell1), *ro2 = pmReadoutAlloc(cell2); // Binned readouts … … 1066 1066 int renormNum = psMetadataLookupS32(&mdok, recipe, "RENORM.NUM"); // Number of samples 1067 1067 float renormWidth = psMetadataLookupS32(&mdok, recipe, "RENORM.WIDTH"); // Width of Gaussian phot 1068 ps MaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask1068 psImageMaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask 1069 1069 if (!pmReadoutWeightRenormPhot(outRO, maskValue, renormNum, renormWidth, 1070 1070 renormMean, renormStdev, NULL)) { … … 1112 1112 psTrace("ppStack", 1, "Gathering statistics on stacked image....\n"); 1113 1113 psString maskBadStr = psMetadataLookupStr(NULL, recipe, "MASK.BAD"); // Name of bits for bad 1114 ps MaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels1114 psImageMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels 1115 1115 1116 1116 ppStatsFPA(stats, outRO->parent->parent->parent, view, maskBad, config);
Note:
See TracChangeset
for help on using the changeset viewer.
