IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 30, 2012, 1:46:12 PM (14 years ago)
Author:
eugene
Message:

merge changes from eam_branches/ipp-20120405

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/psModules

  • trunk/psModules/src/objects/pmSource.c

    r33879 r33963  
    5151    psFree(tmp->pixels);
    5252    psFree(tmp->variance);
     53    psFree(tmp->modelVar);
    5354    psFree(tmp->maskObj);
    5455    psFree(tmp->maskView);
     
    7778    psFree (source->pixels);
    7879    psFree (source->variance);
     80    psFree (source->modelVar);
    7981    psFree (source->maskObj);
    8082    psFree (source->maskView);
     
    8486    source->pixels = NULL;
    8587    source->variance = NULL;
     88    source->modelVar = NULL;
    8689    source->maskObj = NULL;
    8790    source->maskView = NULL;
     
    113116    source->pixels = NULL;
    114117    source->variance = NULL;
     118    source->modelVar = NULL;
    115119    source->maskObj = NULL;
    116120    source->maskView = NULL;
     
    200204    source->pixels   = in->pixels   ? psImageCopyView(NULL, in->pixels)   : NULL;
    201205    source->variance = in->variance ? psImageCopyView(NULL, in->variance) : NULL;
     206    source->modelVar = NULL;
    202207    source->maskView = in->maskView ? psImageCopyView(NULL, in->maskView) : NULL;
    203208
     
    10281033
    10291034    bool addNoise = mode & PM_MODEL_OP_NOISE;
     1035    bool addModelVar = mode & PM_MODEL_OP_MODELVAR;
     1036
     1037    if (addModelVar) psAssert (source->modelVar, "programming error");
    10301038
    10311039    // require the use of pmModelAddWithOffset if we are adding noise (because the model size and norm are rescaled)
     
    10501058        }
    10511059
    1052         psF32 **target = source->pixels->data.F32;
     1060        psF32 **target = addModelVar ? source->modelVar->data.F32 : source->pixels->data.F32;
    10531061
    10541062        for (int iy = 0; iy < source->modelFlux->numRows; iy++) {
     
    10651073            }
    10661074        }
    1067         if (add) {
    1068             source->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED;
    1069         } else {
    1070             source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED;
     1075        if (!addModelVar) {
     1076            if (add) {
     1077                source->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED;
     1078            } else {
     1079                source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED;
     1080            }
    10711081        }
    10721082        return true;
     
    10771087        target = source->variance;
    10781088    }
     1089    if (addModelVar) {
     1090        target = source->modelVar;
     1091    }
    10791092
    10801093    if (add) {
    10811094        status = pmModelAddWithOffset (target, source->maskObj, model, PM_MODEL_OP_FULL, maskVal, dx, dy);
    1082         source->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED;
     1095        if (!addNoise && !addModelVar) source->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED;
    10831096    } else {
    10841097        status = pmModelSubWithOffset (target, source->maskObj, model, PM_MODEL_OP_FULL, maskVal, dx, dy);
    1085         source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED;
     1098        if (!addNoise && !addModelVar) source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED;
    10861099    }
    10871100
Note: See TracChangeset for help on using the changeset viewer.