Changeset 20711 for trunk/ppStack/src/ppStackReadout.c
- Timestamp:
- Nov 12, 2008, 4:59:10 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/ppStack/src/ppStackReadout.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackReadout.c
r20710 r20711 22 22 psArray *subRegions = args->data[3]; // Regions for PSF-matching 23 23 psArray *subKernels = args->data[4]; // Kernels for PSF-matching 24 psVector *addVariance = args->data[5]; // Additional variance when rejecting 25 26 psArray *inspect = ppStackReadoutInitial(config, outRO, thread->readouts, 27 subRegions, subKernels, addVariance); 24 psVector *weightings = args->data[5]; // Weightings (1/noise^2) for each image 25 psVector *addVariance = args->data[6]; // Additional variance when rejecting 26 27 psArray *inspect = ppStackReadoutInitial(config, outRO, thread->readouts, subRegions, subKernels, 28 weightings, addVariance); 28 29 29 30 job->results = inspect; … … 42 43 pmReadout *outRO = args->data[2]; // Output readout 43 44 psArray *rejected = args->data[3]; // Rejected pixels 44 45 bool status = ppStackReadoutFinal(config, outRO, thread->readouts, rejected); // Status of operation 45 psVector *weightings = args->data[4]; // Weighting (1/noise^2) for each image 46 47 bool status = ppStackReadoutFinal(config, outRO, thread->readouts, rejected, 48 weightings); // Status of operation 46 49 47 50 thread->busy = false; … … 77 80 78 81 psArray *ppStackReadoutInitial(const pmConfig *config, pmReadout *outRO, const psArray *readouts, 79 const psArray *regions, const psArray *kernels, const psVector *addVariance) 82 const psArray *regions, const psArray *kernels, const psVector *weightings, 83 const psVector *addVariance) 80 84 { 81 85 assert(config); … … 86 90 assert(readouts->n == regions->n); 87 91 assert(regions->n == kernels->n); 92 assert(weightings && weightings->n == readouts->n && weightings->type.type == PS_TYPE_F32); 88 93 assert(addVariance && addVariance->n == readouts->n && addVariance->type.type == PS_TYPE_F32); 89 94 static int sectionNum = 0; // Section number; for debugging outputs … … 118 123 } 119 124 125 #if 0 126 // This doesn't seem to work, so getting the weightings directly from a vector 120 127 float weighting = psMetadataLookupF32(&mdok, ro->analysis, "PPSTACK.WEIGHTING"); // Relative weight 121 128 if (!mdok || !isfinite(weighting)) { … … 125 132 psLogMsg("ppStack", PS_LOG_INFO, "Weighting for image %d is %f", i, weighting); 126 133 } 134 #endif 127 135 128 136 // Ensure there is a mask, or pmStackCombine will complain … … 132 140 } 133 141 134 stack->data[i] = pmStackDataAlloc(ro, weighting , addVariance->data.F32[i]);142 stack->data[i] = pmStackDataAlloc(ro, weightings->data.F32[i], addVariance->data.F32[i]); 135 143 } 136 144 … … 176 184 177 185 bool ppStackReadoutFinal(const pmConfig *config, pmReadout *outRO, const psArray *readouts, 178 const psArray *rejected )186 const psArray *rejected, const psVector *weightings) 179 187 { 180 188 assert(config); … … 183 191 assert(rejected); 184 192 assert(readouts->n == rejected->n); 193 assert(weightings && weightings->n == readouts->n && weightings->type.type == PS_TYPE_F32); 185 194 186 195 static int sectionNum = 0; … … 212 221 assert(ro); 213 222 223 #if 0 224 // This doesn't seem to work, so getting the weightings directly from a vector 214 225 bool mdok; // Status of MD lookup 215 226 float weighting = psMetadataLookupF32(&mdok, ro->analysis, "PPSTACK.WEIGHTING"); // Relative weight … … 218 229 weighting = 1.0; 219 230 } 231 #endif 220 232 221 233 // Ensure there is a mask, or pmStackCombine will complain … … 225 237 } 226 238 227 pmStackData *data = pmStackDataAlloc(ro, weighting , NAN);239 pmStackData *data = pmStackDataAlloc(ro, weightings->data.F32[i], NAN); 228 240 data->reject = psMemIncrRefCounter(rejected->data[i]); 229 241 stack->data[i] = data;
Note:
See TracChangeset
for help on using the changeset viewer.
