IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 23, 2010, 9:12:53 AM (16 years ago)
Author:
Paul Price
Message:

Pulling r27400 out of the trunk until it can be developed further (compression, make optional). Development will continue on branches/pap_stack/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src/ppStackReadout.c

    r27400 r27402  
    2323    psVector *mask = options->inputMask; // Mask for inputs
    2424    psVector *weightings = options->weightings; // Weightings (1/noise^2) for each image
    25     psVector *exposures = options->exposures;   // Exposure times for each image
    2625    psVector *addVariance = options->matchChi2; // Additional variance when rejecting
    2726
    2827    job->results = ppStackReadoutInitial(config, outRO, thread->readouts, mask,
    29                                          weightings, exposures, addVariance);
     28                                         weightings, addVariance);
    3029    thread->busy = false;
    3130
     
    3837
    3938    psArray *args = job->args;          // Arguments
    40     ppStackThread *thread = args->data[0]; // Thread
    41     psArray *reject = args->data[1];    // Rejected pixels for each image
    42     ppStackOptions *options = args->data[2]; // Options
    43     pmConfig *config = args->data[3];   // Configuration
    44     bool safety = PS_SCALAR_VALUE(args->data[4], U8);    // Safety switch on?
    45     bool normalise = PS_SCALAR_VALUE(args->data[5], U8); // Normalise images?
     39    pmReadout *target = args->data[0];  // Output readout
     40    ppStackThread *thread = args->data[1]; // Thread
     41    psArray *reject = args->data[2];    // Rejected pixels for each image
     42    ppStackOptions *options = args->data[3]; // Options
     43    pmConfig *config = args->data[4];   // Configuration
     44    bool safety = PS_SCALAR_VALUE(args->data[5], U8);    // Safety switch on?
     45    bool normalise = PS_SCALAR_VALUE(args->data[6], U8); // Normalise images?
    4646
    4747    psVector *mask = options->inputMask; // Mask for inputs
    4848    psVector *weightings = options->weightings; // Weightings (1/noise^2) for each image
    49     psVector *exposures = options->exposures;   // Exposure times for each image
    5049    psVector *addVariance = options->matchChi2; // Additional variance when rejecting
    5150    psVector *norm = normalise ? options->norm : NULL; // Normalisations to apply to images
    5251
    53     bool status = ppStackReadoutFinal(config, options->outRO, options->expRO, thread->readouts, mask, reject,
    54                                       weightings, exposures, addVariance, safety, norm); // Status of operation
     52    bool status = ppStackReadoutFinal(config, target, thread->readouts, mask, reject,
     53                                      weightings, addVariance, safety, norm); // Status of operation
    5554
    5655    thread->busy = false;
    57 
    58     psAssert(status, "Stacking failed.");
    5956
    6057    return status;
     
    104101
    105102psArray *ppStackReadoutInitial(const pmConfig *config, pmReadout *outRO, const psArray *readouts,
    106                                const psVector *mask, const psVector *weightings, const psVector *exposures,
    107                                const psVector *addVariance)
     103                               const psVector *mask, const psVector *weightings, const psVector *addVariance)
    108104{
    109105    assert(config);
     
    153149        }
    154150
    155         stack->data[i] = pmStackDataAlloc(ro, weightings->data.F32[i], exposures->data.F32[i],
    156                                           addVariance->data.F32[i]);
    157     }
    158 
    159     if (!pmStackCombine(outRO, NULL, stack, maskVal | maskBad, maskSuspect, maskBad, kernelSize, iter,
     151        stack->data[i] = pmStackDataAlloc(ro, weightings->data.F32[i], addVariance->data.F32[i]);
     152    }
     153
     154    if (!pmStackCombine(outRO, stack, maskVal | maskBad, maskSuspect, maskBad, kernelSize, iter,
    160155                        combineRej, combineSys, combineDiscard, useVariance, safe, false)) {
    161156        psError(PS_ERR_UNKNOWN, false, "Unable to combine input readouts with rejection.");
     
    192187
    193188
    194 bool ppStackReadoutFinal(const pmConfig *config, pmReadout *outRO, pmReadout *expRO, const psArray *readouts,
     189bool ppStackReadoutFinal(const pmConfig *config, pmReadout *outRO, const psArray *readouts,
    195190                         const psVector *mask, const psArray *rejected, const psVector *weightings,
    196                          const psVector *exposures, const psVector *addVariance, bool safety,
    197                          const psVector *norm)
     191                         const psVector *addVariance, bool safety, const psVector *norm)
    198192{
    199193    assert(config);
    200194    assert(outRO);
    201     assert(expRO);
    202195    assert(readouts);
    203196    assert(!rejected || readouts->n == rejected->n);
     
    245238        }
    246239
    247         pmStackData *data = pmStackDataAlloc(ro, weightings->data.F32[i], exposures->data.F32[i],
     240        pmStackData *data = pmStackDataAlloc(ro, weightings->data.F32[i],
    248241                                             addVariance ? addVariance->data.F32[i] : NAN);
    249242        data->reject = rejected ? psMemIncrRefCounter(rejected->data[i]) : NULL;
     
    257250    }
    258251
    259     if (!pmStackCombine(outRO, expRO, stack, maskVal | maskBad, maskSuspect, maskBad, 0, iter, combineRej,
     252    if (!pmStackCombine(outRO, stack, maskVal | maskBad, maskSuspect, maskBad, 0, iter, combineRej,
    260253                        combineSys, combineDiscard, useVariance, safe, rejected)) {
    261254        psError(PS_ERR_UNKNOWN, false, "Unable to combine input readouts.");
     
    266259    pmCell *outCell = outRO->parent;    // Output cell
    267260    pmChip *outChip = outCell->parent;  // Output chip
     261
    268262    outRO->data_exists = true;
    269263    outCell->data_exists = true;
    270264    outChip->data_exists = true;
    271265
    272     pmCell *expCell = expRO->parent;    // Exposure cell
    273     pmChip *expChip = expCell->parent;  // Exposure chip
    274     expRO->data_exists = true;
    275     expCell->data_exists = true;
    276     expChip->data_exists = true;
    277 
    278266    psFree(stack);
    279267
Note: See TracChangeset for help on using the changeset viewer.