Changeset 26076 for trunk/ppStack/src/ppStackReject.c
- Timestamp:
- Nov 9, 2009, 2:53:12 PM (17 years ago)
- Location:
- trunk/ppStack
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/ppStackReject.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/czw_branch/cleanup/ppStack merged eligible /branches/eam_branches/20090522/ppStack merged eligible /branches/eam_branches/20090715/ppStack merged eligible /branches/eam_branches/20090820/ppStack merged eligible /branches/pap/ppStack merged eligible /branches/pap_mops/ppStack 25137-25255
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/ppStack/src/ppStackReject.c
r25466 r26076 23 23 24 24 int num = options->num; // Number of inputs 25 options->rejected = psArrayAlloc(num);26 25 27 26 psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSTACK_RECIPE); // ppStack recipe … … 53 52 psThreadJob *job = psThreadJobAlloc("PPSTACK_INSPECT"); // Job to start 54 53 psArrayAdd(job->args, 1, options->inspect); 54 psArrayAdd(job->args, 1, options->rejected); 55 55 PS_ARRAY_ADD_SCALAR(job->args, i, PS_TYPE_S32); 56 56 if (!psThreadJobAddPending(job)) { … … 92 92 #endif 93 93 94 psPixels *reject = pmStackReject(options->inspect->data[i], options->numCols, options->numRows,95 threshold, poorFrac, stride, options->regions->data[i],96 options->kernels->data[i]); // Rejected pixels97 98 94 #ifdef TESTING 99 95 { 100 psImage *mask = psPixelsToMask(NULL, reject,96 psImage *mask = psPixelsToMask(NULL, options->rejected->data[i], 101 97 psRegionSet(0, options->numCols - 1, 0, options->numRows - 1), 102 98 0xff); // Mask image 103 99 psString name = NULL; // Name of image 104 psStringAppend(&name, " reject_%03d.fits", i);100 psStringAppend(&name, "pre_reject_%03d.fits", i); 105 101 pmStackVisualPlotTestImage(mask, name); 106 102 psFits *fits = psFitsOpen(name, "w"); … … 111 107 } 112 108 #endif 109 110 psPixels *reject = pmStackReject(options->inspect->data[i], options->numCols, options->numRows, 111 threshold, poorFrac, stride, options->regions->data[i], 112 options->kernels->data[i]); // Rejected pixels 113 113 114 114 psFree(options->inspect->data[i]); … … 127 127 "exceeds limit (%.3f)", i, frac, imageRej); 128 128 psFree(reject); 129 // reject == NULL means reject image completely130 129 reject = NULL; 131 130 options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] |= PPSTACK_MASK_BAD; … … 134 133 } 135 134 136 // Images without a list of rejected pixels (the list may be empty) are rejected completely 137 options->rejected->data[i] = reject; 135 if (reject) { 136 // Add to list of pixels already rejected 137 reject = psPixelsConcatenate(reject, options->rejected->data[i]); 138 options->rejected->data[i] = psPixelsDuplicates(options->rejected->data[i], reject); 139 } 140 141 #ifdef TESTING 142 { 143 psImage *mask = psPixelsToMask(NULL, options->rejected->data[i], 144 psRegionSet(0, options->numCols - 1, 0, options->numRows - 1), 145 0xff); // Mask image 146 psString name = NULL; // Name of image 147 psStringAppend(&name, "reject_%03d.fits", i); 148 pmStackVisualPlotTestImage(mask, name); 149 psFits *fits = psFitsOpen(name, "w"); 150 psFree(name); 151 psFitsWriteImage(fits, NULL, mask, 0, NULL); 152 psFree(mask); 153 psFitsClose(fits); 154 } 155 #endif 138 156 139 157 if (options->stats) { … … 143 161 "Number of pixels rejected", reject ? reject->n : 0); 144 162 } 163 164 psFree(reject); 145 165 psLogMsg("ppStack", PS_LOG_INFO, "Time to perform rejection on image %d: %f sec", i, 146 166 psTimerClear("PPSTACK_REJECT"));
Note:
See TracChangeset
for help on using the changeset viewer.
