- Timestamp:
- Sep 19, 2014, 4:05:27 PM (12 years ago)
- Location:
- branches/eam_branches/ps2-tc3-20130727
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ppStack/src/ppStackReadout.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ps2-tc3-20130727
- Property svn:mergeinfo changed
-
branches/eam_branches/ps2-tc3-20130727/ppStack/src/ppStackReadout.c
r36680 r37403 34 34 bool safety = PS_SCALAR_VALUE(args->data[4], U8); // Safety switch on? 35 35 bool normalise = PS_SCALAR_VALUE(args->data[5], U8); // Normalise images? 36 bool bscaleoffset = PS_SCALAR_VALUE(args->data[6], U8); // Apply bscale offset? 36 37 37 38 psVector *mask = options->inputMask; // Mask for inputs … … 40 41 psVector *addVariance = options->matchChi2; // Additional variance when rejecting 41 42 psVector *norm = normalise ? options->norm : NULL; // Normalisations to apply to images 43 psVector *bscaleApplyOffset = bscaleoffset ? options->bscaleOffset : NULL; // BSCALE offset to apply to images 42 44 43 45 bool status = ppStackReadoutFinal(config, options->outRO, options->expRO, thread->readouts, mask, reject, 44 weightings, exposures, addVariance, safety, norm ); // Status of operation46 weightings, exposures, addVariance, safety, norm, bscaleApplyOffset); // Status of operation 45 47 46 48 thread->busy = false; … … 116 118 bool useVariance = psMetadataLookupBool(&mdok, recipe, "VARIANCE"); // Use variance for rejection? 117 119 bool safe = psMetadataLookupBool(&mdok, recipe, "SAFE"); // Be safe when combining small numbers of pixels 120 121 int nminpix = psMetadataLookupS32(&mdok, recipe, "NMINPIX"); // Minimum input per pixel to combine with 118 122 119 123 psMetadata *ppsub = psMetadataLookupMetadata(NULL, config->recipes, "PPSUB"); // PPSUB recipe … … 161 165 162 166 if (!pmStackCombine(outRO, NULL, stack, maskBad, maskSuspect, maskBlank, kernelSize, iter, 163 combineRej, combineSys, combineDiscard, useVariance, safe, false)) {167 combineRej, combineSys, combineDiscard, useVariance, safe, nminpix, false)) { 164 168 psError(PS_ERR_UNKNOWN, false, "Unable to combine input readouts with rejection."); 165 169 psFree(stack); … … 184 188 psFree(stack); 185 189 186 psLogMsg("ppStack", PS_LOG_INFO, "initial stack image sectionNum %d", sectionNum); 190 //MEH change to trace 191 //psLogMsg("ppStack", PS_LOG_INFO, "initial stack image sectionNum %d", sectionNum); 187 192 188 193 sectionNum++; … … 199 204 const psVector *mask, const psArray *rejected, const psVector *weightings, 200 205 const psVector *exposures, const psVector *addVariance, bool safety, 201 const psVector *norm )206 const psVector *norm, const psVector *bscaleApplyOffset) 202 207 { 203 208 assert(config); … … 218 223 bool useVariance = psMetadataLookupBool(&mdok, recipe, "VARIANCE"); // Use variance for rejection? 219 224 bool safe = psMetadataLookupBool(&mdok, recipe, "SAFE"); // Be safe when combining small numbers of pixels 225 226 int nminpix = psMetadataLookupS32(&mdok, recipe, "NMINPIX"); // Minimum input per pixel to combine with 220 227 221 228 psString maskBadStr = psMetadataLookupStr(NULL, recipe, "MASK.VAL"); // Name of bits to mask for bad … … 267 274 stack->data[i] = data; 268 275 276 //MEH -- apply bscale offset before norm 277 if (bscaleApplyOffset) { 278 //MEH change to trace 279 //psLogMsg("ppStack", PS_LOG_INFO, "bscaleApplyOffset: %d %f", i, bscaleApplyOffset->data.F32[i]); 280 psBinaryOp(ro->image, ro->image, "-", psScalarAlloc(bscaleApplyOffset->data.F32[i], PS_TYPE_F32)); 281 } 282 269 283 if (norm) { 270 284 float normalise = powf(10.0, -0.4 * norm->data.F32[i]); // Normalisation … … 275 289 276 290 if (!pmStackCombine(outRO, expRO, stack, maskBad, maskSuspect, maskBlank, 0, iter, combineRej, 277 combineSys, combineDiscard, useVariance, safe, rejected)) {291 combineSys, combineDiscard, useVariance, safe, nminpix, rejected)) { 278 292 psError(PS_ERR_UNKNOWN, false, "Unable to combine input readouts."); 279 293 psFree(stack); … … 295 309 psFree(stack); 296 310 297 psLogMsg("ppStack", PS_LOG_INFO, "final stack image sectionNum %d", sectionNum); 311 //MEH change to trace 312 //psLogMsg("ppStack", PS_LOG_INFO, "final stack image sectionNum %d", sectionNum); 298 313 299 314 sectionNum++;
Note:
See TracChangeset
for help on using the changeset viewer.
