IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 8, 2012, 6:32:36 AM (14 years ago)
Author:
eugene
Message:

ifdef-ed out all modelVar related code from recent updates. turn on or off with pmModel.h HAVE_MODEL_VAR

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmSource.c

    r33963 r33993  
    5151    psFree(tmp->pixels);
    5252    psFree(tmp->variance);
     53# if (HAVE_MODEL_VAR)
    5354    psFree(tmp->modelVar);
     55# endif
    5456    psFree(tmp->maskObj);
    5557    psFree(tmp->maskView);
     
    7880    psFree (source->pixels);
    7981    psFree (source->variance);
     82# if (HAVE_MODEL_VAR)
    8083    psFree (source->modelVar);
     84# endif
    8185    psFree (source->maskObj);
    8286    psFree (source->maskView);
     
    8690    source->pixels = NULL;
    8791    source->variance = NULL;
     92# if (HAVE_MODEL_VAR)
    8893    source->modelVar = NULL;
     94# endif
    8995    source->maskObj = NULL;
    9096    source->maskView = NULL;
     
    116122    source->pixels = NULL;
    117123    source->variance = NULL;
     124# if (HAVE_MODEL_VAR)
    118125    source->modelVar = NULL;
     126# endif
    119127    source->maskObj = NULL;
    120128    source->maskView = NULL;
     
    204212    source->pixels   = in->pixels   ? psImageCopyView(NULL, in->pixels)   : NULL;
    205213    source->variance = in->variance ? psImageCopyView(NULL, in->variance) : NULL;
     214# if (HAVE_MODEL_VAR)
    206215    source->modelVar = NULL;
     216# endif
    207217    source->maskView = in->maskView ? psImageCopyView(NULL, in->maskView) : NULL;
    208218
     
    10331043
    10341044    bool addNoise = mode & PM_MODEL_OP_NOISE;
     1045
     1046# if (HAVE_MODEL_VAR)
    10351047    bool addModelVar = mode & PM_MODEL_OP_MODELVAR;
    1036 
    10371048    if (addModelVar) psAssert (source->modelVar, "programming error");
     1049# endif
    10381050
    10391051    // require the use of pmModelAddWithOffset if we are adding noise (because the model size and norm are rescaled)
     
    10581070        }
    10591071
     1072# if (HAVE_MODEL_VAR)
    10601073        psF32 **target = addModelVar ? source->modelVar->data.F32 : source->pixels->data.F32;
     1074# else
     1075        psF32 **target = source->pixels->data.F32;
     1076# endif
    10611077
    10621078        for (int iy = 0; iy < source->modelFlux->numRows; iy++) {
     
    10731089            }
    10741090        }
     1091# if (HAVE_MODEL_VAR)
    10751092        if (!addModelVar) {
    10761093            if (add) {
     
    10801097            }
    10811098        }
     1099# else
     1100        if (add) {
     1101            source->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED;
     1102        } else {
     1103            source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED;
     1104        }
     1105# endif
    10821106        return true;
    10831107    }
     
    10871111        target = source->variance;
    10881112    }
     1113# if (HAVE_MODEL_VAR)
    10891114    if (addModelVar) {
    10901115        target = source->modelVar;
    10911116    }
     1117# endif
    10921118
    10931119    if (add) {
    10941120        status = pmModelAddWithOffset (target, source->maskObj, model, PM_MODEL_OP_FULL, maskVal, dx, dy);
     1121# if (HAVE_MODEL_VAR)
    10951122        if (!addNoise && !addModelVar) source->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED;
     1123# else
     1124        source->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED;
     1125# endif
    10961126    } else {
    10971127        status = pmModelSubWithOffset (target, source->maskObj, model, PM_MODEL_OP_FULL, maskVal, dx, dy);
     1128# if (HAVE_MODEL_VAR)
    10981129        if (!addNoise && !addModelVar) source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED;
     1130# else
     1131        source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED;
     1132# endif
    10991133    }
    11001134
Note: See TracChangeset for help on using the changeset viewer.