Changeset 21183 for trunk/ppStack
- Timestamp:
- Jan 26, 2009, 8:40:07 PM (17 years ago)
- Location:
- trunk/ppStack/src
- Files:
-
- 6 edited
-
ppStackArguments.c (modified) (1 diff)
-
ppStackLoop.c (modified) (17 diffs)
-
ppStackMatch.c (modified) (2 diffs)
-
ppStackPhotometry.c (modified) (3 diffs)
-
ppStackReadout.c (modified) (4 diffs)
-
ppStackSources.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackArguments.c
r20995 r21183 79 79 } \ 80 80 } \ 81 ps MaskType value = pmConfigMaskGet(name, config); \82 psMetadataAdd U8(recipe, PS_LIST_TAIL, RECIPENAME, PS_META_REPLACE, NULL, value); \81 psImageMaskType value = pmConfigMaskGet(name, config); \ 82 psMetadataAddImageMask(recipe, PS_LIST_TAIL, RECIPENAME, PS_META_REPLACE, NULL, value); \ 83 83 } 84 84 -
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); -
trunk/ppStack/src/ppStackMatch.c
r21021 r21183 104 104 105 105 // Generate a background model of the readout we're matching 106 psImage *stackBackgroundModel(pmReadout *ro, ps MaskType maskVal, const psArray *sources, int size)106 psImage *stackBackgroundModel(pmReadout *ro, psImageMaskType maskVal, const psArray *sources, int size) 107 107 { 108 108 psImage *image = ro->image, *mask = ro->mask; // Image and mask of readout … … 169 169 170 170 psString maskValStr = psMetadataLookupStr(NULL, recipe, "MASK.VAL"); // Name of bits to mask going in 171 ps MaskType maskVal = pmConfigMaskGet(maskValStr, config); // Bits to mask going in to pmSubtractionMatch171 psImageMaskType maskVal = pmConfigMaskGet(maskValStr, config); // Bits to mask going in to pmSubtractionMatch 172 172 psString maskPoorStr = psMetadataLookupStr(NULL, recipe, "MASK.POOR"); // Name of bits to mask for poor 173 ps MaskType maskPoor = pmConfigMaskGet(maskPoorStr, config); // Bits to mask for poor pixels173 psImageMaskType maskPoor = pmConfigMaskGet(maskPoorStr, config); // Bits to mask for poor pixels 174 174 psString maskBadStr = psMetadataLookupStr(NULL, recipe, "MASK.BAD"); // Name of bits to mask for bad 175 ps MaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels175 psImageMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels 176 176 177 177 bool mdok; // Status of MD lookup -
trunk/ppStack/src/ppStackPhotometry.c
r20995 r21183 45 45 return false; 46 46 } 47 ps MaskType maskVal = pmConfigMaskGet(maskValStr, config); // Bits to mask47 psImageMaskType maskVal = pmConfigMaskGet(maskValStr, config); // Bits to mask 48 48 49 49 psImage *image = ro->image, *mask = ro->mask; // Image and mask from readout … … 85 85 float dy2 = PS_SQR(y - v); // Distance from centroid 86 86 for (int u = xMin; u <= xMax; u++) { 87 if (mask->data.PS_TYPE_ MASK_DATA[v][u] & maskVal) {87 if (mask->data.PS_TYPE_IMAGE_MASK_DATA[v][u] & maskVal) { 88 88 numBadPix++; 89 89 continue; … … 133 133 134 134 // set maskValue and markValue in the psphot recipe 135 ps MaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask136 ps MaskType markValue = pmConfigMaskGet("MARK.VALUE", config); // Bits to use for marking137 psMetadataAdd U8(recipe, PS_LIST_TAIL, "MASK.PSPHOT", PS_META_REPLACE, "Bits to mask", maskValue);138 psMetadataAdd U8(recipe, PS_LIST_TAIL, "MARK.PSPHOT", PS_META_REPLACE, "Bits to use for mark", markValue);135 psImageMaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask 136 psImageMaskType markValue = pmConfigMaskGet("MARK.VALUE", config); // Bits to use for marking 137 psMetadataAddImageMask (recipe, PS_LIST_TAIL, "MASK.PSPHOT", PS_META_REPLACE, "Bits to mask", maskValue); 138 psMetadataAddImageMask (recipe, PS_LIST_TAIL, "MARK.PSPHOT", PS_META_REPLACE, "Bits to use for mark", markValue); 139 139 140 140 if (!psphotReadout(config, view)) { -
trunk/ppStack/src/ppStackReadout.c
r20884 r21183 114 114 115 115 psString maskValStr = psMetadataLookupStr(NULL, recipe, "MASK.VAL"); // Name of bits to mask going in 116 ps MaskType maskVal = pmConfigMaskGet(maskValStr, config); // Bits to mask going in to pmSubtractionMatch116 psImageMaskType maskVal = pmConfigMaskGet(maskValStr, config); // Bits to mask going in to pmSubtractionMatch 117 117 psString maskBadStr = psMetadataLookupStr(NULL, recipe, "MASK.BAD"); // Name of bits to mask for bad 118 ps MaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels118 psImageMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels 119 119 120 120 int num = readouts->n; // Number of inputs … … 141 141 // Ensure there is a mask, or pmStackCombine will complain 142 142 if (!ro->mask) { 143 ro->mask = psImageAlloc(ro->image->numCols, ro->image->numRows, PS_TYPE_ MASK);143 ro->mask = psImageAlloc(ro->image->numCols, ro->image->numRows, PS_TYPE_IMAGE_MASK); 144 144 psImageInit(ro->mask, 0); 145 145 } … … 208 208 209 209 psString maskValStr = psMetadataLookupStr(NULL, recipe, "MASK.VAL"); // Name of bits to mask going in 210 ps MaskType maskVal = pmConfigMaskGet(maskValStr, config); // Bits to mask going in to pmSubtractionMatch210 psImageMaskType maskVal = pmConfigMaskGet(maskValStr, config); // Bits to mask going in to pmSubtractionMatch 211 211 psString maskBadStr = psMetadataLookupStr(NULL, recipe, "MASK.BAD"); // Name of bits to mask for bad 212 ps MaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels212 psImageMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels 213 213 214 214 int num = readouts->n; // Number of inputs … … 238 238 // Ensure there is a mask, or pmStackCombine will complain 239 239 if (!ro->mask) { 240 ro->mask = psImageAlloc(ro->image->numCols, ro->image->numRows, PS_TYPE_ MASK);240 ro->mask = psImageAlloc(ro->image->numCols, ro->image->numRows, PS_TYPE_IMAGE_MASK); 241 241 psImageInit(ro->mask, 0); 242 242 } -
trunk/ppStack/src/ppStackSources.c
r21092 r21183 109 109 psVectorInit(mag, NAN); 110 110 for (int j = 0; j < match->num; j++) { 111 if (match->mask->data.PS_TYPE_ MASK_DATA[j]) {111 if (match->mask->data.PS_TYPE_VECTOR_MASK_DATA[j]) { 112 112 continue; 113 113 }
Note:
See TracChangeset
for help on using the changeset viewer.
