IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 12, 2008, 4:59:10 PM (17 years ago)
Author:
Paul Price
Message:

Can't figure out why the weightings which are being placed on readout->analysis aren't getting to the combination stage, so I'm putting them in a vector and passing them explicitly.

File:
1 edited

Legend:

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

    r20710 r20711  
    2222    psArray *subRegions = args->data[3]; // Regions for PSF-matching
    2323    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);
    2829
    2930    job->results = inspect;
     
    4243    pmReadout *outRO = args->data[2];   // Output readout
    4344    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
    4649
    4750    thread->busy = false;
     
    7780
    7881psArray *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)
    8084{
    8185    assert(config);
     
    8690    assert(readouts->n == regions->n);
    8791    assert(regions->n == kernels->n);
     92    assert(weightings && weightings->n == readouts->n && weightings->type.type == PS_TYPE_F32);
    8893    assert(addVariance && addVariance->n == readouts->n && addVariance->type.type == PS_TYPE_F32);
    8994    static int sectionNum = 0;          // Section number; for debugging outputs
     
    118123        }
    119124
     125#if 0
     126        // This doesn't seem to work, so getting the weightings directly from a vector
    120127        float weighting = psMetadataLookupF32(&mdok, ro->analysis, "PPSTACK.WEIGHTING"); // Relative weight
    121128        if (!mdok || !isfinite(weighting)) {
     
    125132            psLogMsg("ppStack", PS_LOG_INFO, "Weighting for image %d is %f", i, weighting);
    126133        }
     134#endif
    127135
    128136        // Ensure there is a mask, or pmStackCombine will complain
     
    132140        }
    133141
    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]);
    135143    }
    136144
     
    176184
    177185bool ppStackReadoutFinal(const pmConfig *config, pmReadout *outRO, const psArray *readouts,
    178                          const psArray *rejected)
     186                         const psArray *rejected, const psVector *weightings)
    179187{
    180188    assert(config);
     
    183191    assert(rejected);
    184192    assert(readouts->n == rejected->n);
     193    assert(weightings && weightings->n == readouts->n && weightings->type.type == PS_TYPE_F32);
    185194
    186195    static int sectionNum = 0;
     
    212221        assert(ro);
    213222
     223#if 0
     224        // This doesn't seem to work, so getting the weightings directly from a vector
    214225        bool mdok;                      // Status of MD lookup
    215226        float weighting = psMetadataLookupF32(&mdok, ro->analysis, "PPSTACK.WEIGHTING"); // Relative weight
     
    218229            weighting = 1.0;
    219230        }
     231#endif
    220232
    221233        // Ensure there is a mask, or pmStackCombine will complain
     
    225237        }
    226238
    227         pmStackData *data = pmStackDataAlloc(ro, weighting, NAN);
     239        pmStackData *data = pmStackDataAlloc(ro, weightings->data.F32[i], NAN);
    228240        data->reject = psMemIncrRefCounter(rejected->data[i]);
    229241        stack->data[i] = data;
Note: See TracChangeset for help on using the changeset viewer.