Changeset 21183 for trunk/ppStack/src/ppStackLoop.c
- Timestamp:
- Jan 26, 2009, 8:40:07 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/ppStack/src/ppStackLoop.c (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackLoop.c
r21092 r21183 403 403 int numGood = 0; // Number of good frames 404 404 int numCols = 0, numRows = 0; // Size of image 405 psVector *inputMask = psVectorAlloc(num, PS_TYPE_ U8); // Mask for inputs405 psVector *inputMask = psVectorAlloc(num, PS_TYPE_VECTOR_MASK); // Mask for inputs 406 406 psVectorInit(inputMask, 0); 407 407 psVector *matchChi2 = psVectorAlloc(num, PS_TYPE_F32); // chi^2 for stamps when matching … … 449 449 sourceLists->data[i], targetPSF, rng, config)) { 450 450 psErrorStackPrint(stderr, "Unable to match image %d --- ignoring.", i); 451 inputMask->data. U8[i] = PPSTACK_MASK_MATCH;451 inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = PPSTACK_MASK_MATCH; 452 452 psErrorClear(); 453 453 continue; … … 536 536 psVector *values = psVectorAllocEmpty(num, PS_TYPE_F32); // Values to sort 537 537 for (int i = 0; i < num; i++) { 538 if (inputMask->data.PS_TYPE_ MASK_DATA[i] & PPSTACK_MASK_ALL) {538 if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] & PPSTACK_MASK_ALL) { 539 539 continue; 540 540 } … … 569 569 numGood = 0; // Number of good images 570 570 for (int i = 0; i < num; i++) { 571 if (inputMask->data.PS_TYPE_MASK_DATA[i] & PPSTACK_MASK_ALL) {571 if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] & PPSTACK_MASK_ALL) { 572 572 continue; 573 573 } 574 574 if (matchChi2->data.F32[i] > thresh) { 575 575 numRej++; 576 inputMask->data.PS_TYPE_ MASK_DATA[i] |= PPSTACK_MASK_CHI2;576 inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] |= PPSTACK_MASK_CHI2; 577 577 psLogMsg("ppStack", PS_LOG_INFO, "Rejecting image %d because of large matching chi^2: %f", 578 578 i, matchChi2->data.F32[i]); … … 647 647 648 648 psString maskBadStr = psMetadataLookupStr(NULL, recipe, "MASK.BAD"); // Name of bits to mask for bad 649 ps MaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels649 psImageMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels 650 650 if (!pmReadoutStackDefineOutput(outRO, col0, row0, numCols, numRows, true, true, maskBad)) { 651 651 psError(PS_ERR_UNKNOWN, false, "Unable to prepare output."); … … 728 728 inspect = psArrayAlloc(num); 729 729 for (int i = 0; i < num; i++) { 730 if (inputMask->data. U8[i]) {730 if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) { 731 731 continue; 732 732 } … … 739 739 psArray *results = job->results; // Results of job 740 740 for (int i = 0; i < num; i++) { 741 if (inputMask->data. U8[i]) {741 if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) { 742 742 continue; 743 743 } … … 765 765 // Count images rejected out of hand 766 766 for (int i = 0; i < num; i++) { 767 if (inputMask->data. U8[i]) {767 if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) { 768 768 numRejected++; 769 769 } … … 771 771 772 772 for (int i = 0; i < num; i++) { 773 if (inputMask->data. U8[i]) {773 if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) { 774 774 continue; 775 775 } … … 816 816 // Reject bad pixels 817 817 for (int i = 0; i < num; i++) { 818 if (inputMask->data. U8[i]) {818 if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) { 819 819 continue; 820 820 } … … 859 859 psWarning("Rejection on image %d didn't work --- reject entire image.", i); 860 860 numRejected++; 861 inputMask->data. U8[i] = PPSTACK_MASK_REJECT;861 inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = PPSTACK_MASK_REJECT; 862 862 } else { 863 863 float frac = reject->n / (float)(numCols * numRows); // Pixel fraction … … 870 870 // reject == NULL means reject image completely 871 871 reject = NULL; 872 inputMask->data. U8[i] = PPSTACK_MASK_BAD;872 inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = PPSTACK_MASK_BAD; 873 873 numRejected++; 874 874 } … … 982 982 { 983 983 psString maskBadStr = psMetadataLookupStr(NULL, recipe, "MASK.BAD"); // Name of bits for bad 984 ps MaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels984 psImageMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels 985 985 if (!pmReadoutMaskApply(outRO, maskBad)) { 986 986 psWarning("Unable to apply mask"); … … 992 992 bool wcsDone = false; // Have we done the WCS? 993 993 for (int i = 0; i < num; i++) { 994 if (inputMask->data. U8[i]) {994 if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) { 995 995 continue; 996 996 } … … 1056 1056 pmCell *cell1 = pmFPAfileThisCell(config->files, view, "PPSTACK.OUTPUT.JPEG1"); 1057 1057 pmCell *cell2 = pmFPAfileThisCell(config->files, view, "PPSTACK.OUTPUT.JPEG2"); 1058 ps MaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask1058 psImageMaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask 1059 1059 1060 1060 pmReadout *ro1 = pmReadoutAlloc(cell1), *ro2 = pmReadoutAlloc(cell2); // Binned readouts … … 1078 1078 int renormNum = psMetadataLookupS32(&mdok, recipe, "RENORM.NUM"); // Number of samples 1079 1079 float renormWidth = psMetadataLookupS32(&mdok, recipe, "RENORM.WIDTH"); // Width of Gaussian phot 1080 ps MaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask1080 psImageMaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask 1081 1081 if (!pmReadoutWeightRenormPhot(outRO, maskValue, renormNum, renormWidth, 1082 1082 renormMean, renormStdev, NULL)) { … … 1124 1124 psTrace("ppStack", 1, "Gathering statistics on stacked image....\n"); 1125 1125 psString maskBadStr = psMetadataLookupStr(NULL, recipe, "MASK.BAD"); // Name of bits for bad 1126 ps MaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels1126 psImageMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels 1127 1127 1128 1128 ppStatsFPA(stats, outRO->parent->parent->parent, view, maskBad, config);
Note:
See TracChangeset
for help on using the changeset viewer.
