IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 17, 2014, 5:58:38 AM (12 years ago)
Author:
eugene
Message:

merge in changes from trunk (up through pv3 tag)

Location:
branches/eam_branches/ipp-20140610
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140610

  • branches/eam_branches/ipp-20140610/ppStack/src/ppStackReadout.c

    r36710 r36884  
    3434    bool safety = PS_SCALAR_VALUE(args->data[4], U8);    // Safety switch on?
    3535    bool normalise = PS_SCALAR_VALUE(args->data[5], U8); // Normalise images?
     36    bool bscaleoffset = PS_SCALAR_VALUE(args->data[6], U8); // Apply bscale offset?
    3637
    3738    psVector *mask = options->inputMask; // Mask for inputs
     
    4041    psVector *addVariance = options->matchChi2; // Additional variance when rejecting
    4142    psVector *norm = normalise ? options->norm : NULL; // Normalisations to apply to images
     43    psVector *bscaleApplyOffset = bscaleoffset ? options->bscaleOffset : NULL; // BSCALE offset to apply to images
    4244
    4345    bool status = ppStackReadoutFinal(config, options->outRO, options->expRO, thread->readouts, mask, reject,
    44                                       weightings, exposures, addVariance, safety, norm); // Status of operation
     46                                      weightings, exposures, addVariance, safety, norm, bscaleApplyOffset); // Status of operation
    4547
    4648    thread->busy = false;
     
    201203                         const psVector *mask, const psArray *rejected, const psVector *weightings,
    202204                         const psVector *exposures, const psVector *addVariance, bool safety,
    203                          const psVector *norm)
     205                         const psVector *norm, const psVector *bscaleApplyOffset)
    204206{
    205207    assert(config);
     
    271273        stack->data[i] = data;
    272274
     275        //MEH -- apply bscale offset before norm   
     276        if (bscaleApplyOffset) {
     277            psLogMsg("ppStack", PS_LOG_INFO, "bscaleApplyOffset: %d %f", i, bscaleApplyOffset->data.F32[i]);
     278            psBinaryOp(ro->image, ro->image, "-", psScalarAlloc(bscaleApplyOffset->data.F32[i], PS_TYPE_F32));
     279        }
     280
    273281        if (norm) {
    274282            float normalise = powf(10.0, -0.4 * norm->data.F32[i]); // Normalisation
Note: See TracChangeset for help on using the changeset viewer.