IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 5, 2009, 4:31:25 PM (17 years ago)
Author:
Paul Price
Message:

Merging pap_branch_20090128. Resolved a small number of conflicts. Compiles, but not tested in detail.

Location:
trunk/psModules/src/objects
Files:
11 edited

Legend:

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

    r21183 r21363  
    44 *
    55 * @author EAM, IfA
    6  * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    7  * @date $Date: 2009-01-27 06:39:38 $
     6 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     7 * @date $Date: 2009-02-06 02:31:25 $
    88 * Copyright 2004 IfA, University of Hawaii
    99 */
     
    2323    psFree (resid->Rx);
    2424    psFree (resid->Ry);
    25     psFree (resid->weight);
     25    psFree (resid->variance);
    2626    psFree (resid->mask);
    2727    return;
     
    4242    resid->Rx  = psImageAlloc (nX, nY, PS_TYPE_F32);
    4343    resid->Ry  = psImageAlloc (nX, nY, PS_TYPE_F32);
    44     resid->weight = psImageAlloc (nX, nY, PS_TYPE_F32);
     44    resid->variance = psImageAlloc (nX, nY, PS_TYPE_F32);
    4545    resid->mask   = psImageAlloc (nX, nY, PM_TYPE_RESID_MASK);
    4646
     
    4949    resid->xBin = xBin;
    5050    resid->yBin = yBin;
    51     resid->xCenter = 0.5*(nX - 1); 
     51    resid->xCenter = 0.5*(nX - 1);
    5252    resid->yCenter = 0.5*(nY - 1);
    5353    return resid;
  • trunk/psModules/src/objects/pmResiduals.h

    r21183 r21363  
    44 *
    55 * @author EAM, IfA
    6  * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    7  * @date $Date: 2009-01-27 06:39:38 $
     6 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     7 * @date $Date: 2009-02-06 02:31:25 $
    88 * Copyright 2004 IfA, University of Hawaii
    99 */
     
    1414/// @{
    1515
    16 /** residual tables for sources 
     16/** residual tables for sources
    1717 */
    1818typedef struct {
     
    2020    psImage *Rx;
    2121    psImage *Ry;
    22     psImage *weight;
     22    psImage *variance;
    2323    psImage *mask;
    2424    int xBin;
     
    3131bool psMemCheckResiduals(psPtr ptr);
    3232
    33 // macros to abstract the resid mask type : these values must be consistent 
     33// macros to abstract the resid mask type : these values must be consistent
    3434#define PM_TYPE_RESID_MASK PS_TYPE_U8        /**< the psElemType to use for mask image */
    3535#define PM_TYPE_RESID_MASK_DATA U8           /**< the data member to use for mask image */
  • trunk/psModules/src/objects/pmSource.c

    r21352 r21363  
    66 *  @author EAM, IfA: significant modifications.
    77 *
    8  *  @version $Revision: 1.68 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2009-02-06 01:09:50 $
     8 *  @version $Revision: 1.69 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-02-06 02:31:25 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4444    psFree(tmp->peak);
    4545    psFree(tmp->pixels);
    46     psFree(tmp->weight);
     46    psFree(tmp->variance);
    4747    psFree(tmp->maskObj);
    4848    psFree(tmp->maskView);
     
    6666
    6767    psFree (source->pixels);
    68     psFree (source->weight);
     68    psFree (source->variance);
    6969    psFree (source->maskObj);
    7070    psFree (source->maskView);
     
    7373
    7474    source->pixels = NULL;
    75     source->weight = NULL;
     75    source->variance = NULL;
    7676    source->maskObj = NULL;
    7777    source->maskView = NULL;
     
    101101    source->peak = NULL;
    102102    source->pixels = NULL;
    103     source->weight = NULL;
     103    source->variance = NULL;
    104104    source->maskObj = NULL;
    105105    source->maskView = NULL;
     
    144144    }
    145145    // this copy is used to allow multiple fit attempts on the
    146     // same object.  the pixels, weight, and mask arrays all point to
     146    // same object.  the pixels, variance, and mask arrays all point to
    147147    // the same original subarrays.  the peak and moments point at
    148148    // the original values.
     
    167167    // We want a new view, but pointing at the same pixels.
    168168    source->pixels   = psImageCopyView(NULL, in->pixels);
    169     source->weight   = psImageCopyView(NULL, in->weight);
     169    source->variance   = psImageCopyView(NULL, in->variance);
    170170    source->maskView = in->maskView ? psImageCopyView(NULL, in->maskView) : NULL;
    171171
     
    199199    // these images are subset images of the equivalent parents
    200200    mySource->pixels = psImageSubset(readout->image, srcRegion);
    201     if (readout->weight) {
    202         mySource->weight = psImageSubset(readout->weight, srcRegion);
     201    if (readout->variance) {
     202        mySource->variance = psImageSubset(readout->variance, srcRegion);
    203203    }
    204204    if (readout->mask) {
     
    237237
    238238    extend |= (mySource->pixels == NULL);
    239     extend |= (mySource->weight == NULL);
     239    extend |= (mySource->variance == NULL);
    240240    extend |= (mySource->maskObj == NULL);
    241241    extend |= (mySource->maskView == NULL);
     
    245245        // re-create the subimage
    246246        psFree (mySource->pixels);
    247         psFree (mySource->weight);
     247        psFree (mySource->variance);
    248248        psFree (mySource->maskView);
    249249
    250250        mySource->pixels   = psImageSubset(readout->image,  newRegion);
    251         mySource->weight   = psImageSubset(readout->weight, newRegion);
     251        mySource->variance   = psImageSubset(readout->variance, newRegion);
    252252        mySource->maskView = psImageSubset(readout->mask,   newRegion);
    253253        mySource->region   = newRegion;
     
    670670    pmSource->peak
    671671    pmSource->pixels
    672     pmSource->weight
     672    pmSource->variance
    673673    pmSource->mask
    674674
     
    737737
    738738        psF32 *vPix = source->pixels->data.F32[row];
    739         psF32 *vWgt = source->weight->data.F32[row];
     739        psF32 *vWgt = source->variance->data.F32[row];
    740740        psImageMaskType *vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[row];
    741741
     
    924924        if (mode & PM_MODEL_OP_NOISE) {
    925925            // XXX need to scale by the gain...
    926             target = source->weight->data.F32;
     926            target = source->variance->data.F32;
    927927        }
    928928
     
    946946    psImage *target = source->pixels;
    947947    if (mode & PM_MODEL_OP_NOISE) {
    948         target = source->weight;
     948        target = source->variance;
    949949    }
    950950
  • trunk/psModules/src/objects/pmSource.h

    r21183 r21363  
    33 * @author EAM, IfA; GLG, MHPCC
    44 *
    5  * @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
    6  * @date $Date: 2009-01-27 06:39:38 $
     5 * @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
     6 * @date $Date: 2009-02-06 02:31:25 $
    77 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    88 */
     
    7272    pmPeak  *peak;                      ///< Description of peak pixel.
    7373    psImage *pixels;                    ///< Rectangular region including object pixels.
    74     psImage *weight;                    ///< Image variance.
     74    psImage *variance;                    ///< Image variance.
    7575    psImage *maskObj;                   ///< unique mask for this object which marks included pixels associated with objects.
    7676    psImage *maskView;                  ///< view into global image mask for this object region
     
    210210    psMetadata *metadata,               ///< Contains classification parameters
    211211    pmPSFClump clump,                   ///< Statistics about the PSF clump
    212     psImageMaskType maskSat             ///< Mask value for saturated pixels
     212    psImageMaskType maskSat             ///< Mask value for saturated pixels
    213213);
    214214
  • trunk/psModules/src/objects/pmSourceExtendedPars.c

    r20937 r21363  
    66 *  @author EAM, IfA: significant modifications.
    77 *
    8  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2008-12-08 02:51:14 $
     8 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-02-06 02:31:25 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    7171    psFree(profile->radius);
    7272    psFree(profile->flux);
    73     psFree(profile->weight);
     73    psFree(profile->variance);
    7474    return;
    7575}
     
    8282    profile->radius = NULL;
    8383    profile->flux = NULL;
    84     profile->weight = NULL;
     84    profile->variance = NULL;
    8585
    8686    return profile;
  • trunk/psModules/src/objects/pmSourceExtendedPars.h

    r15980 r21363  
    33 * @author EAM, IfA
    44 *
    5  * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    6  * @date $Date: 2008-01-02 20:39:04 $
     5 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     6 * @date $Date: 2009-02-06 02:31:25 $
    77 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    88 */
     
    1717  psVector *radius;
    1818  psVector *flux;
    19   psVector *weight;
     19  psVector *variance;
    2020} pmSourceRadialProfile;
    2121
  • trunk/psModules/src/objects/pmSourceFitModel.c

    r21183 r21363  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2009-01-27 06:39:38 $
     8 *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-02-06 02:31:25 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6262    PS_ASSERT_PTR_NON_NULL(source->pixels, false);
    6363    PS_ASSERT_PTR_NON_NULL(source->maskObj, false);
    64     PS_ASSERT_PTR_NON_NULL(source->weight, false);
     64    PS_ASSERT_PTR_NON_NULL(source->variance, false);
    6565
    6666    psBool fitStatus = true;
     
    8484                continue;
    8585            }
    86             // skip zero-weight points
    87             if (source->weight->data.F32[i][j] == 0) {
     86            // skip zero-variance points
     87            if (source->variance->data.F32[i][j] == 0) {
    8888                continue;
    8989            }
     
    102102
    103103            // psMinimizeLMChi2 takes wt = 1/dY^2.  suggestion from RHL is to use the local sky
    104             // as weight to avoid the bias from systematic errors here we would just use the
     104            // as variance to avoid the bias from systematic errors here we would just use the
    105105            // source sky variance
    106106            if (PM_SOURCE_FIT_MODEL_PIX_WEIGHTS) {
    107                 yErr->data.F32[nPix] = 1.0 / source->weight->data.F32[i][j];
     107                yErr->data.F32[nPix] = 1.0 / source->variance->data.F32[i][j];
    108108            } else {
    109109                yErr->data.F32[nPix] = 1.0 / PM_SOURCE_FIT_MODEL_WEIGHT;
  • trunk/psModules/src/objects/pmSourceFitSet.c

    r21183 r21363  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2009-01-27 06:39:38 $
     8 *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-02-06 02:31:25 $
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    1111 *
     
    5555
    5656    if (!fitSets) {
    57         fitSets = psArrayAlloc (PS_MAX (1, nThreads));
    58     }
    59 
    60     // the allocated elements should be NULL on psArrayAlloc, 
    61     // and a previously allocated array of fitSets should have been cleared 
     57        fitSets = psArrayAlloc (PS_MAX (1, nThreads));
     58    }
     59
     60    // the allocated elements should be NULL on psArrayAlloc,
     61    // and a previously allocated array of fitSets should have been cleared
    6262    // before pmSourceFitSetInit is called
    6363    for (int i = 0; i < fitSets->n; i++) {
    64         psAssert (fitSets->data[i] == NULL, "failure to init or clear fitSets?");
     64        psAssert (fitSets->data[i] == NULL, "failure to init or clear fitSets?");
    6565    }
    6666    return true;
     
    125125    // we do not need to lock to do this....
    126126    for (int i = 0; i < fitSets->n; i++) {
    127         thisSet = fitSets->data[i];
    128         if (!thisSet) continue;
    129         if (thisSet->thread == id) {
    130             break;
    131         }
    132         thisSet = NULL;
     127        thisSet = fitSets->data[i];
     128        if (!thisSet) continue;
     129        if (thisSet->thread == id) {
     130            break;
     131        }
     132        thisSet = NULL;
    133133    }
    134134    psAssert (thisSet == NULL, "pmSourceFitSetDataSet() called but previous entry not cleared");
     
    137137
    138138    pthread_mutex_lock (&fitSetInitMutex);
    139          
     139
    140140    // find an entry that is NULL and place it there
    141141    for (int i = 0; i < fitSets->n; i++) {
    142         if (fitSets->data[i]) continue;
    143         fitSets->data[i] = thisSet;
    144         pthread_mutex_unlock (&fitSetInitMutex);
    145         return thisSet;
     142        if (fitSets->data[i]) continue;
     143        fitSets->data[i] = thisSet;
     144        pthread_mutex_unlock (&fitSetInitMutex);
     145        return thisSet;
    146146    }
    147147    pthread_mutex_unlock (&fitSetInitMutex);
     
    160160    pmSourceFitSetData *thisSet = NULL;
    161161    for (int i = 0; i < fitSets->n; i++) {
    162         thisSet = fitSets->data[i];
    163         if (!thisSet) continue;
    164         if (thisSet->thread == id) {
    165             break;
    166         }
    167         thisSet = NULL;
     162        thisSet = fitSets->data[i];
     163        if (!thisSet) continue;
     164        if (thisSet->thread == id) {
     165            break;
     166        }
     167        thisSet = NULL;
    168168    }
    169169    psAssert (thisSet != NULL, "pmSourceFitSetDataGet() called, but no entry found");
     
    184184    pmSourceFitSetData *thisSet = NULL;
    185185    for (i = 0; i < fitSets->n; i++) {
    186         thisSet = fitSets->data[i];
    187         if (!thisSet) continue;
    188         if (thisSet->thread == id) {
    189             break;
    190         }
    191         thisSet = NULL;
     186        thisSet = fitSets->data[i];
     187        if (!thisSet) continue;
     188        if (thisSet->thread == id) {
     189            break;
     190        }
     191        thisSet = NULL;
    192192    }
    193193    psAssert (thisSet != NULL, "pmSourceFitSetDataClear() called, but no entry found");
     
    256256        psVector *derivOne = set->derivSet->data[i];
    257257
    258         // one or the other (param or deriv) must be set
    259         assert ((deriv != NULL) || (param != NULL));
    260 
    261         // if we are setting derive, derivOne and paramOne must be same length
     258        // one or the other (param or deriv) must be set
     259        assert ((deriv != NULL) || (param != NULL));
     260
     261        // if we are setting derive, derivOne and paramOne must be same length
    262262        assert ((deriv == NULL) || (paramOne->n == derivOne->n));
    263        
     263
    264264        for (int j = 0; j < paramOne->n; j++, n++) {
    265             if (param) {
    266                 param->data.F32[n] = paramOne->data.F32[j];
    267             }
     265            if (param) {
     266                param->data.F32[n] = paramOne->data.F32[j];
     267            }
    268268            if (deriv) {
    269269                deriv->data.F32[n] = derivOne->data.F32[j];
     
    275275
    276276// distribute parameters from single param and deriv vectors into FitSet models
    277 bool pmSourceFitSetSplit (pmSourceFitSetData *set, const psVector *deriv, const psVector *param) 
     277bool pmSourceFitSetSplit (pmSourceFitSetData *set, const psVector *deriv, const psVector *param)
    278278{
    279279    PS_ASSERT_VECTOR_NON_NULL(param, false);
     
    301301
    302302// set the model parameters for this fit set
    303 bool pmSourceFitSetValues (pmSourceFitSetData *set, const psVector *dparam, 
     303bool pmSourceFitSetValues (pmSourceFitSetData *set, const psVector *dparam,
    304304                           const psVector *param, pmSource *source,
    305305                           psMinimization *myMin, int nPix, bool fitStatus)
     
    420420
    421421    for (int i = 0; i < modelSet->n; i++) {
    422         pmModel *model = modelSet->data[i];
    423         int nParams = pmModelClassParameterCount (model->type);
    424         for (int j = 0; j < nParams; j++) {
    425             fprintf (file, "%d %d  : %f %f\n", i, j, model->params->data.F32[j], model->dparams->data.F32[j]);
    426         }
     422        pmModel *model = modelSet->data[i];
     423        int nParams = pmModelClassParameterCount (model->type);
     424        for (int j = 0; j < nParams; j++) {
     425            fprintf (file, "%d %d  : %f %f\n", i, j, model->params->data.F32[j], model->dparams->data.F32[j]);
     426        }
    427427    }
    428428    return true;
     
    435435        psVector *derivOne = set->derivSet->data[i];
    436436        for (int j = 0; j < paramOne->n; j++) {
    437             fprintf (file, "%d %d  : %f %f\n", i, j, paramOne->data.F32[j], derivOne->data.F32[j]);
     437            fprintf (file, "%d %d  : %f %f\n", i, j, paramOne->data.F32[j], derivOne->data.F32[j]);
    438438        }
    439439    }
     
    450450    PS_ASSERT_PTR_NON_NULL(source->pixels, false);
    451451    PS_ASSERT_PTR_NON_NULL(source->maskObj, false);
    452     PS_ASSERT_PTR_NON_NULL(source->weight, false);
     452    PS_ASSERT_PTR_NON_NULL(source->variance, false);
    453453
    454454    bool fitStatus = true;
     
    471471                continue;
    472472            }
    473             // skip zero-weight points
    474             if (source->weight->data.F32[i][j] == 0) {
     473            // skip zero-variance points
     474            if (source->variance->data.F32[i][j] == 0) {
    475475                continue;
    476476            }
     
    489489
    490490            // psMinimizeLMChi2 takes wt = 1/dY^2.  suggestion from RHL is to use the local sky
    491             // as weight to avoid the bias from systematic errors here we would just use the
     491            // as variance to avoid the bias from systematic errors here we would just use the
    492492            // source sky variance
    493493            if (PM_SOURCE_FIT_MODEL_PIX_WEIGHTS) {
    494                 yErr->data.F32[nPix] = 1.0 / source->weight->data.F32[i][j];
     494                yErr->data.F32[nPix] = 1.0 / source->variance->data.F32[i][j];
    495495            } else {
    496496                yErr->data.F32[nPix] = 1.0 / PM_SOURCE_FIT_MODEL_WEIGHT;
     
    543543        psFree (params);
    544544        psFree(constraint);
    545         pmSourceFitSetDataClear(); // frees thisSet and removes if from the array of fitSets
     545        pmSourceFitSetDataClear(); // frees thisSet and removes if from the array of fitSets
    546546        return(false);
    547547    }
  • trunk/psModules/src/objects/pmSourceMoments.c

    r21183 r21363  
    66 *  @author EAM, IfA: significant modifications.
    77 *
    8  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2009-01-27 06:39:38 $
     8 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-02-06 02:31:25 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4747    pmSource->peak
    4848    pmSource->pixels
    49     pmSource->weight (optional)
     49    pmSource->variance (optional)
    5050    pmSource->mask (optional)
    5151
     
    9999
    100100        psF32 *vPix = source->pixels->data.F32[row];
    101         psF32 *vWgt = source->weight->data.F32[row];
     101        psF32 *vWgt = source->variance->data.F32[row];
    102102        psImageMaskType *vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[row];
    103103
     
    110110                vMsk++;
    111111            }
    112             if (isnan(*vPix)) continue;
     112            if (isnan(*vPix)) continue;
    113113
    114114            psF32 xDiff = col - xPeak;
     
    189189
    190190        psF32 *vPix = source->pixels->data.F32[row];
    191         psF32 *vWgt = source->weight->data.F32[row];
     191        psF32 *vWgt = source->variance->data.F32[row];
    192192        psImageMaskType  *vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[row];
    193193
     
    200200                vMsk++;
    201201            }
    202             if (isnan(*vPix)) continue;
     202            if (isnan(*vPix)) continue;
    203203
    204204            psF32 xDiff = col - xCM;
     
    206206
    207207            // radius is just a function of (xDiff, yDiff)
    208             psF32 r2  = PS_SQR(xDiff) + PS_SQR(yDiff);
    209             psF32 r  = sqrt(r2);
     208            psF32 r2  = PS_SQR(xDiff) + PS_SQR(yDiff);
     209            psF32 r  = sqrt(r2);
    210210            if (r > radius) continue;
    211211
     
    278278
    279279    psTrace ("psModules.objects", 4, "Mxx: %f  Mxy: %f  Myy: %f  Mxxx: %f  Mxxy: %f  Mxyy: %f  Myyy: %f  Mxxxx: %f  Mxxxy: %f  Mxxyy: %f  Mxyyy: %f  Mxyyy: %f\n",
    280              source->moments->Mxx,   source->moments->Mxy,   source->moments->Myy, 
     280             source->moments->Mxx,   source->moments->Mxy,   source->moments->Myy,
    281281             source->moments->Mxxx,  source->moments->Mxxy,  source->moments->Mxyy,  source->moments->Myyy,
    282282             source->moments->Mxxxx, source->moments->Mxxxy, source->moments->Mxxyy, source->moments->Mxyyy, source->moments->Myyyy);
     
    286286
    287287    if (source->moments->Mxx < 0) {
    288         fprintf (stderr, "error: neg second moment??\n");
     288        fprintf (stderr, "error: neg second moment??\n");
    289289    }
    290290    if (source->moments->Myy < 0) {
    291         fprintf (stderr, "error: neg second moment??\n");
     291        fprintf (stderr, "error: neg second moment??\n");
    292292    }
    293293
     
    341341
    342342        psF32 *vPix = source->pixels->data.F32[row];
    343         psF32 *vWgt = source->weight->data.F32[row];
     343        psF32 *vWgt = source->variance->data.F32[row];
    344344        psImageMaskType  *vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[row];
    345345
     
    352352                vMsk++;
    353353            }
    354             if (isnan(*vPix)) continue;
     354            if (isnan(*vPix)) continue;
    355355
    356356            psF32 xDiff = col - xPeak;
     
    407407    }
    408408
    409 # if (PS_TRACE_ON) 
     409# if (PS_TRACE_ON)
    410410    float Sxx = PS_MAX(X2/Sum - PS_SQR(x), 0);
    411411    float Sxy = XY / Sum;
  • trunk/psModules/src/objects/pmSourcePhotometry.c

    r21183 r21363  
    33 *  @author EAM, IfA; GLG, MHPCC
    44 *
    5  *  @version $Revision: 1.48 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2009-01-27 06:39:38 $
     5 *  @version $Revision: 1.49 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2009-02-06 02:31:25 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    446446    assert (Pj != NULL);
    447447
    448     const psImage *Wi = Mi->weight;
     448    const psImage *Wi = Mi->variance;
    449449    if (!unweighted_sum) {
    450450        assert (Wi != NULL);
     
    511511    assert (Pj != NULL);
    512512
    513     const psImage *Wi = Mi->weight;
     513    const psImage *Wi = Mi->variance;
    514514    if (!unweighted_sum) {
    515515        assert (Wi != NULL);
     
    567567    const psImage *Pi = Mi->pixels;
    568568    assert (Pi != NULL);
    569     const psImage *Wi = Mi->weight;
     569    const psImage *Wi = Mi->variance;
    570570    if (!unweighted_sum) {
    571571        assert (Wi != NULL);
     
    612612# endif
    613613
    614 bool pmSourceChisq (pmModel *model, psImage *image, psImage *mask, psImage *weight,
     614bool pmSourceChisq (pmModel *model, psImage *image, psImage *mask, psImage *variance,
    615615                    psImageMaskType maskVal)
    616616{
     
    618618    PS_ASSERT_PTR_NON_NULL(image, false);
    619619    PS_ASSERT_PTR_NON_NULL(mask, false);
    620     PS_ASSERT_PTR_NON_NULL(weight, false);
     620    PS_ASSERT_PTR_NON_NULL(variance, false);
    621621
    622622    double dC = 0.0;
     
    626626            if (mask->data.PS_TYPE_IMAGE_MASK_DATA[j][i] & maskVal)
    627627                continue;
    628             if (weight->data.F32[j][i] <= 0)
    629                 continue;
    630             dC += PS_SQR (image->data.F32[j][i]) / weight->data.F32[j][i];
     628            if (variance->data.F32[j][i] <= 0)
     629                continue;
     630            dC += PS_SQR (image->data.F32[j][i]) / variance->data.F32[j][i];
    631631            Npix ++;
    632632        }
     
    648648    const psImage *Pi = Mi->modelFlux;
    649649    assert (Pi != NULL);
    650     const psImage *Wi = Mi->weight;
     650    const psImage *Wi = Mi->variance;
    651651    if (!unweighted_sum) {
    652652        assert (Wi != NULL);
     
    706706    assert (Pj != NULL);
    707707
    708     const psImage *Wi = Mi->weight;
     708    const psImage *Wi = Mi->variance;
    709709    if (!unweighted_sum) {
    710710        assert (Wi != NULL);
     
    770770    assert (Pj != NULL);
    771771
    772     const psImage *Wi = Mi->weight;
     772    const psImage *Wi = Mi->variance;
    773773    if (!unweighted_sum) {
    774774        assert (Wi != NULL);
  • trunk/psModules/src/objects/pmSourceSky.c

    r21183 r21363  
    66 *  @author EAM, IfA: significant modifications.
    77 *
    8  *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2009-01-27 06:39:38 $
     8 *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-02-06 02:31:25 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    113113    psTrace("psModules.objects", 3, "---- %s() begin ----\n", __func__);
    114114    PS_ASSERT_PTR_NON_NULL(source, false);
    115     PS_ASSERT_IMAGE_NON_NULL(source->weight, false);
     115    PS_ASSERT_IMAGE_NON_NULL(source->variance, false);
    116116    PS_ASSERT_IMAGE_NON_NULL(source->maskObj, false);
    117117    PS_ASSERT_PTR_NON_NULL(source->peak, false);
     
    127127    }
    128128
    129     psImage *image = source->weight;
     129    psImage *image = source->variance;
    130130    psImage *mask  = source->maskObj;
    131131    pmPeak *peak  = source->peak;
Note: See TracChangeset for help on using the changeset viewer.