Changeset 21363 for trunk/psModules/src/objects
- Timestamp:
- Feb 5, 2009, 4:31:25 PM (17 years ago)
- Location:
- trunk/psModules/src/objects
- Files:
-
- 11 edited
-
pmResiduals.c (modified) (4 diffs)
-
pmResiduals.h (modified) (4 diffs)
-
pmSource.c (modified) (14 diffs)
-
pmSource.h (modified) (3 diffs)
-
pmSourceExtendedPars.c (modified) (3 diffs)
-
pmSourceExtendedPars.h (modified) (2 diffs)
-
pmSourceFitModel.c (modified) (4 diffs)
-
pmSourceFitSet.c (modified) (15 diffs)
-
pmSourceMoments.c (modified) (12 diffs)
-
pmSourcePhotometry.c (modified) (10 diffs)
-
pmSourceSky.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmResiduals.c
r21183 r21363 4 4 * 5 5 * @author EAM, IfA 6 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $7 * @date $Date: 2009-0 1-27 06:39:38$6 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2009-02-06 02:31:25 $ 8 8 * Copyright 2004 IfA, University of Hawaii 9 9 */ … … 23 23 psFree (resid->Rx); 24 24 psFree (resid->Ry); 25 psFree (resid-> weight);25 psFree (resid->variance); 26 26 psFree (resid->mask); 27 27 return; … … 42 42 resid->Rx = psImageAlloc (nX, nY, PS_TYPE_F32); 43 43 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); 45 45 resid->mask = psImageAlloc (nX, nY, PM_TYPE_RESID_MASK); 46 46 … … 49 49 resid->xBin = xBin; 50 50 resid->yBin = yBin; 51 resid->xCenter = 0.5*(nX - 1); 51 resid->xCenter = 0.5*(nX - 1); 52 52 resid->yCenter = 0.5*(nY - 1); 53 53 return resid; -
trunk/psModules/src/objects/pmResiduals.h
r21183 r21363 4 4 * 5 5 * @author EAM, IfA 6 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $7 * @date $Date: 2009-0 1-27 06:39:38$6 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2009-02-06 02:31:25 $ 8 8 * Copyright 2004 IfA, University of Hawaii 9 9 */ … … 14 14 /// @{ 15 15 16 /** residual tables for sources 16 /** residual tables for sources 17 17 */ 18 18 typedef struct { … … 20 20 psImage *Rx; 21 21 psImage *Ry; 22 psImage * weight;22 psImage *variance; 23 23 psImage *mask; 24 24 int xBin; … … 31 31 bool psMemCheckResiduals(psPtr ptr); 32 32 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 34 34 #define PM_TYPE_RESID_MASK PS_TYPE_U8 /**< the psElemType to use for mask image */ 35 35 #define PM_TYPE_RESID_MASK_DATA U8 /**< the data member to use for mask image */ -
trunk/psModules/src/objects/pmSource.c
r21352 r21363 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1.6 8$ $Name: not supported by cvs2svn $9 * @date $Date: 2009-02-06 0 1:09:50$8 * @version $Revision: 1.69 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2009-02-06 02:31:25 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 44 44 psFree(tmp->peak); 45 45 psFree(tmp->pixels); 46 psFree(tmp-> weight);46 psFree(tmp->variance); 47 47 psFree(tmp->maskObj); 48 48 psFree(tmp->maskView); … … 66 66 67 67 psFree (source->pixels); 68 psFree (source-> weight);68 psFree (source->variance); 69 69 psFree (source->maskObj); 70 70 psFree (source->maskView); … … 73 73 74 74 source->pixels = NULL; 75 source-> weight= NULL;75 source->variance = NULL; 76 76 source->maskObj = NULL; 77 77 source->maskView = NULL; … … 101 101 source->peak = NULL; 102 102 source->pixels = NULL; 103 source-> weight= NULL;103 source->variance = NULL; 104 104 source->maskObj = NULL; 105 105 source->maskView = NULL; … … 144 144 } 145 145 // this copy is used to allow multiple fit attempts on the 146 // same object. the pixels, weight, and mask arrays all point to146 // same object. the pixels, variance, and mask arrays all point to 147 147 // the same original subarrays. the peak and moments point at 148 148 // the original values. … … 167 167 // We want a new view, but pointing at the same pixels. 168 168 source->pixels = psImageCopyView(NULL, in->pixels); 169 source-> weight = psImageCopyView(NULL, in->weight);169 source->variance = psImageCopyView(NULL, in->variance); 170 170 source->maskView = in->maskView ? psImageCopyView(NULL, in->maskView) : NULL; 171 171 … … 199 199 // these images are subset images of the equivalent parents 200 200 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); 203 203 } 204 204 if (readout->mask) { … … 237 237 238 238 extend |= (mySource->pixels == NULL); 239 extend |= (mySource-> weight== NULL);239 extend |= (mySource->variance == NULL); 240 240 extend |= (mySource->maskObj == NULL); 241 241 extend |= (mySource->maskView == NULL); … … 245 245 // re-create the subimage 246 246 psFree (mySource->pixels); 247 psFree (mySource-> weight);247 psFree (mySource->variance); 248 248 psFree (mySource->maskView); 249 249 250 250 mySource->pixels = psImageSubset(readout->image, newRegion); 251 mySource-> weight = psImageSubset(readout->weight, newRegion);251 mySource->variance = psImageSubset(readout->variance, newRegion); 252 252 mySource->maskView = psImageSubset(readout->mask, newRegion); 253 253 mySource->region = newRegion; … … 670 670 pmSource->peak 671 671 pmSource->pixels 672 pmSource-> weight672 pmSource->variance 673 673 pmSource->mask 674 674 … … 737 737 738 738 psF32 *vPix = source->pixels->data.F32[row]; 739 psF32 *vWgt = source-> weight->data.F32[row];739 psF32 *vWgt = source->variance->data.F32[row]; 740 740 psImageMaskType *vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[row]; 741 741 … … 924 924 if (mode & PM_MODEL_OP_NOISE) { 925 925 // XXX need to scale by the gain... 926 target = source-> weight->data.F32;926 target = source->variance->data.F32; 927 927 } 928 928 … … 946 946 psImage *target = source->pixels; 947 947 if (mode & PM_MODEL_OP_NOISE) { 948 target = source-> weight;948 target = source->variance; 949 949 } 950 950 -
trunk/psModules/src/objects/pmSource.h
r21183 r21363 3 3 * @author EAM, IfA; GLG, MHPCC 4 4 * 5 * @version $Revision: 1.2 7$ $Name: not supported by cvs2svn $6 * @date $Date: 2009-0 1-27 06:39:38$5 * @version $Revision: 1.28 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2009-02-06 02:31:25 $ 7 7 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 8 8 */ … … 72 72 pmPeak *peak; ///< Description of peak pixel. 73 73 psImage *pixels; ///< Rectangular region including object pixels. 74 psImage * weight; ///< Image variance.74 psImage *variance; ///< Image variance. 75 75 psImage *maskObj; ///< unique mask for this object which marks included pixels associated with objects. 76 76 psImage *maskView; ///< view into global image mask for this object region … … 210 210 psMetadata *metadata, ///< Contains classification parameters 211 211 pmPSFClump clump, ///< Statistics about the PSF clump 212 psImageMaskType maskSat ///< Mask value for saturated pixels212 psImageMaskType maskSat ///< Mask value for saturated pixels 213 213 ); 214 214 -
trunk/psModules/src/objects/pmSourceExtendedPars.c
r20937 r21363 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $9 * @date $Date: 200 8-12-08 02:51:14$8 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2009-02-06 02:31:25 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 71 71 psFree(profile->radius); 72 72 psFree(profile->flux); 73 psFree(profile-> weight);73 psFree(profile->variance); 74 74 return; 75 75 } … … 82 82 profile->radius = NULL; 83 83 profile->flux = NULL; 84 profile-> weight= NULL;84 profile->variance = NULL; 85 85 86 86 return profile; -
trunk/psModules/src/objects/pmSourceExtendedPars.h
r15980 r21363 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $6 * @date $Date: 200 8-01-02 20:39:04$5 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2009-02-06 02:31:25 $ 7 7 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 8 8 */ … … 17 17 psVector *radius; 18 18 psVector *flux; 19 psVector * weight;19 psVector *variance; 20 20 } pmSourceRadialProfile; 21 21 -
trunk/psModules/src/objects/pmSourceFitModel.c
r21183 r21363 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1. 29$ $Name: not supported by cvs2svn $9 * @date $Date: 2009-0 1-27 06:39:38$8 * @version $Revision: 1.30 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2009-02-06 02:31:25 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 62 62 PS_ASSERT_PTR_NON_NULL(source->pixels, false); 63 63 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); 65 65 66 66 psBool fitStatus = true; … … 84 84 continue; 85 85 } 86 // skip zero- weightpoints87 if (source-> weight->data.F32[i][j] == 0) {86 // skip zero-variance points 87 if (source->variance->data.F32[i][j] == 0) { 88 88 continue; 89 89 } … … 102 102 103 103 // psMinimizeLMChi2 takes wt = 1/dY^2. suggestion from RHL is to use the local sky 104 // as weightto avoid the bias from systematic errors here we would just use the104 // as variance to avoid the bias from systematic errors here we would just use the 105 105 // source sky variance 106 106 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]; 108 108 } else { 109 109 yErr->data.F32[nPix] = 1.0 / PM_SOURCE_FIT_MODEL_WEIGHT; -
trunk/psModules/src/objects/pmSourceFitSet.c
r21183 r21363 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.1 4$ $Name: not supported by cvs2svn $9 * @date $Date: 2009-0 1-27 06:39:38$8 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2009-02-06 02:31:25 $ 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 11 11 * … … 55 55 56 56 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 62 62 // before pmSourceFitSetInit is called 63 63 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?"); 65 65 } 66 66 return true; … … 125 125 // we do not need to lock to do this.... 126 126 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; 133 133 } 134 134 psAssert (thisSet == NULL, "pmSourceFitSetDataSet() called but previous entry not cleared"); … … 137 137 138 138 pthread_mutex_lock (&fitSetInitMutex); 139 139 140 140 // find an entry that is NULL and place it there 141 141 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; 146 146 } 147 147 pthread_mutex_unlock (&fitSetInitMutex); … … 160 160 pmSourceFitSetData *thisSet = NULL; 161 161 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; 168 168 } 169 169 psAssert (thisSet != NULL, "pmSourceFitSetDataGet() called, but no entry found"); … … 184 184 pmSourceFitSetData *thisSet = NULL; 185 185 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; 192 192 } 193 193 psAssert (thisSet != NULL, "pmSourceFitSetDataClear() called, but no entry found"); … … 256 256 psVector *derivOne = set->derivSet->data[i]; 257 257 258 // one or the other (param or deriv) must be set259 assert ((deriv != NULL) || (param != NULL));260 261 // if we are setting derive, derivOne and paramOne must be same length258 // 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 262 262 assert ((deriv == NULL) || (paramOne->n == derivOne->n)); 263 263 264 264 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 } 268 268 if (deriv) { 269 269 deriv->data.F32[n] = derivOne->data.F32[j]; … … 275 275 276 276 // distribute parameters from single param and deriv vectors into FitSet models 277 bool pmSourceFitSetSplit (pmSourceFitSetData *set, const psVector *deriv, const psVector *param) 277 bool pmSourceFitSetSplit (pmSourceFitSetData *set, const psVector *deriv, const psVector *param) 278 278 { 279 279 PS_ASSERT_VECTOR_NON_NULL(param, false); … … 301 301 302 302 // set the model parameters for this fit set 303 bool pmSourceFitSetValues (pmSourceFitSetData *set, const psVector *dparam, 303 bool pmSourceFitSetValues (pmSourceFitSetData *set, const psVector *dparam, 304 304 const psVector *param, pmSource *source, 305 305 psMinimization *myMin, int nPix, bool fitStatus) … … 420 420 421 421 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 } 427 427 } 428 428 return true; … … 435 435 psVector *derivOne = set->derivSet->data[i]; 436 436 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]); 438 438 } 439 439 } … … 450 450 PS_ASSERT_PTR_NON_NULL(source->pixels, false); 451 451 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); 453 453 454 454 bool fitStatus = true; … … 471 471 continue; 472 472 } 473 // skip zero- weightpoints474 if (source-> weight->data.F32[i][j] == 0) {473 // skip zero-variance points 474 if (source->variance->data.F32[i][j] == 0) { 475 475 continue; 476 476 } … … 489 489 490 490 // psMinimizeLMChi2 takes wt = 1/dY^2. suggestion from RHL is to use the local sky 491 // as weightto avoid the bias from systematic errors here we would just use the491 // as variance to avoid the bias from systematic errors here we would just use the 492 492 // source sky variance 493 493 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]; 495 495 } else { 496 496 yErr->data.F32[nPix] = 1.0 / PM_SOURCE_FIT_MODEL_WEIGHT; … … 543 543 psFree (params); 544 544 psFree(constraint); 545 pmSourceFitSetDataClear(); // frees thisSet and removes if from the array of fitSets545 pmSourceFitSetDataClear(); // frees thisSet and removes if from the array of fitSets 546 546 return(false); 547 547 } -
trunk/psModules/src/objects/pmSourceMoments.c
r21183 r21363 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $9 * @date $Date: 2009-0 1-27 06:39:38$8 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2009-02-06 02:31:25 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 47 47 pmSource->peak 48 48 pmSource->pixels 49 pmSource-> weight(optional)49 pmSource->variance (optional) 50 50 pmSource->mask (optional) 51 51 … … 99 99 100 100 psF32 *vPix = source->pixels->data.F32[row]; 101 psF32 *vWgt = source-> weight->data.F32[row];101 psF32 *vWgt = source->variance->data.F32[row]; 102 102 psImageMaskType *vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[row]; 103 103 … … 110 110 vMsk++; 111 111 } 112 if (isnan(*vPix)) continue;112 if (isnan(*vPix)) continue; 113 113 114 114 psF32 xDiff = col - xPeak; … … 189 189 190 190 psF32 *vPix = source->pixels->data.F32[row]; 191 psF32 *vWgt = source-> weight->data.F32[row];191 psF32 *vWgt = source->variance->data.F32[row]; 192 192 psImageMaskType *vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[row]; 193 193 … … 200 200 vMsk++; 201 201 } 202 if (isnan(*vPix)) continue;202 if (isnan(*vPix)) continue; 203 203 204 204 psF32 xDiff = col - xCM; … … 206 206 207 207 // 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); 210 210 if (r > radius) continue; 211 211 … … 278 278 279 279 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, 281 281 source->moments->Mxxx, source->moments->Mxxy, source->moments->Mxyy, source->moments->Myyy, 282 282 source->moments->Mxxxx, source->moments->Mxxxy, source->moments->Mxxyy, source->moments->Mxyyy, source->moments->Myyyy); … … 286 286 287 287 if (source->moments->Mxx < 0) { 288 fprintf (stderr, "error: neg second moment??\n");288 fprintf (stderr, "error: neg second moment??\n"); 289 289 } 290 290 if (source->moments->Myy < 0) { 291 fprintf (stderr, "error: neg second moment??\n");291 fprintf (stderr, "error: neg second moment??\n"); 292 292 } 293 293 … … 341 341 342 342 psF32 *vPix = source->pixels->data.F32[row]; 343 psF32 *vWgt = source-> weight->data.F32[row];343 psF32 *vWgt = source->variance->data.F32[row]; 344 344 psImageMaskType *vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[row]; 345 345 … … 352 352 vMsk++; 353 353 } 354 if (isnan(*vPix)) continue;354 if (isnan(*vPix)) continue; 355 355 356 356 psF32 xDiff = col - xPeak; … … 407 407 } 408 408 409 # if (PS_TRACE_ON) 409 # if (PS_TRACE_ON) 410 410 float Sxx = PS_MAX(X2/Sum - PS_SQR(x), 0); 411 411 float Sxy = XY / Sum; -
trunk/psModules/src/objects/pmSourcePhotometry.c
r21183 r21363 3 3 * @author EAM, IfA; GLG, MHPCC 4 4 * 5 * @version $Revision: 1.4 8$ $Name: not supported by cvs2svn $6 * @date $Date: 2009-0 1-27 06:39:38$5 * @version $Revision: 1.49 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2009-02-06 02:31:25 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 446 446 assert (Pj != NULL); 447 447 448 const psImage *Wi = Mi-> weight;448 const psImage *Wi = Mi->variance; 449 449 if (!unweighted_sum) { 450 450 assert (Wi != NULL); … … 511 511 assert (Pj != NULL); 512 512 513 const psImage *Wi = Mi-> weight;513 const psImage *Wi = Mi->variance; 514 514 if (!unweighted_sum) { 515 515 assert (Wi != NULL); … … 567 567 const psImage *Pi = Mi->pixels; 568 568 assert (Pi != NULL); 569 const psImage *Wi = Mi-> weight;569 const psImage *Wi = Mi->variance; 570 570 if (!unweighted_sum) { 571 571 assert (Wi != NULL); … … 612 612 # endif 613 613 614 bool pmSourceChisq (pmModel *model, psImage *image, psImage *mask, psImage * weight,614 bool pmSourceChisq (pmModel *model, psImage *image, psImage *mask, psImage *variance, 615 615 psImageMaskType maskVal) 616 616 { … … 618 618 PS_ASSERT_PTR_NON_NULL(image, false); 619 619 PS_ASSERT_PTR_NON_NULL(mask, false); 620 PS_ASSERT_PTR_NON_NULL( weight, false);620 PS_ASSERT_PTR_NON_NULL(variance, false); 621 621 622 622 double dC = 0.0; … … 626 626 if (mask->data.PS_TYPE_IMAGE_MASK_DATA[j][i] & maskVal) 627 627 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]; 631 631 Npix ++; 632 632 } … … 648 648 const psImage *Pi = Mi->modelFlux; 649 649 assert (Pi != NULL); 650 const psImage *Wi = Mi-> weight;650 const psImage *Wi = Mi->variance; 651 651 if (!unweighted_sum) { 652 652 assert (Wi != NULL); … … 706 706 assert (Pj != NULL); 707 707 708 const psImage *Wi = Mi-> weight;708 const psImage *Wi = Mi->variance; 709 709 if (!unweighted_sum) { 710 710 assert (Wi != NULL); … … 770 770 assert (Pj != NULL); 771 771 772 const psImage *Wi = Mi-> weight;772 const psImage *Wi = Mi->variance; 773 773 if (!unweighted_sum) { 774 774 assert (Wi != NULL); -
trunk/psModules/src/objects/pmSourceSky.c
r21183 r21363 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1. 19$ $Name: not supported by cvs2svn $9 * @date $Date: 2009-0 1-27 06:39:38$8 * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2009-02-06 02:31:25 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 113 113 psTrace("psModules.objects", 3, "---- %s() begin ----\n", __func__); 114 114 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); 116 116 PS_ASSERT_IMAGE_NON_NULL(source->maskObj, false); 117 117 PS_ASSERT_PTR_NON_NULL(source->peak, false); … … 127 127 } 128 128 129 psImage *image = source-> weight;129 psImage *image = source->variance; 130 130 psImage *mask = source->maskObj; 131 131 pmPeak *peak = source->peak;
Note:
See TracChangeset
for help on using the changeset viewer.
