Changeset 9527 for trunk/psModules/src/objects/pmSourcePhotometry.c
- Timestamp:
- Oct 12, 2006, 4:24:34 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmSourcePhotometry.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmSourcePhotometry.c
r8815 r9527 3 3 * @author EAM, IfA; GLG, MHPCC 4 4 * 5 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $6 * @date $Date: 2006- 09-15 09:49:01$5 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2006-10-13 02:24:34 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 95 95 } 96 96 97 if (model->dparams->data.F32[ 1] > 0) {98 SN = model->params->data.F32[ 1] / model->dparams->data.F32[1];97 if (model->dparams->data.F32[PM_PAR_FLUX] > 0) { 98 SN = model->params->data.F32[PM_PAR_FLUX] / model->dparams->data.F32[PM_PAR_FLUX]; 99 99 source->errMag = 1.0 / SN; 100 100 } else { … … 102 102 source->errMag = 0.0; 103 103 } 104 x = model->params->data.F32[ 2];105 y = model->params->data.F32[ 3];104 x = model->params->data.F32[PM_PAR_XPOS]; 105 y = model->params->data.F32[PM_PAR_YPOS]; 106 106 107 107 // measure object model photometry … … 194 194 195 195 if (DO_SKY) { 196 sky = model->params->data.F32[ 0];196 sky = model->params->data.F32[PM_PAR_SKY]; 197 197 } else { 198 198 sky = 0; … … 233 233 // we only care about the value of the object model, not the local sky 234 234 if (DO_SKY) { 235 sky = model->params->data.F32[ 0];235 sky = model->params->data.F32[PM_PAR_SKY]; 236 236 } else { 237 237 sky = 0; … … 245 245 psVector *params = model->params; 246 246 247 Xo = params->data.F32[ 2];248 Yo = params->data.F32[ 3];247 Xo = params->data.F32[PM_PAR_XPOS]; 248 Yo = params->data.F32[PM_PAR_YPOS]; 249 249 250 250 dX = Xo - image->col0; … … 297 297 } 298 298 299 float pmSourceCrossProduct (pmSource *Mi, pmSource *Mj) 299 double pmSourceCrossProduct (const pmSource *Mi, 300 const pmSource *Mj, 301 const bool unweighted_sum) // should the cross product be weighted? 300 302 { 301 303 … … 304 306 int xIs, xJs, yIs, yJs; 305 307 int xIe, yIe; 306 floatflux, wt;307 308 psImage *Pi = Mi->pixels;309 psImage *Pj = Mj->pixels;310 311 psImage *Wi = Mi->weight;312 313 psImage *Ti = Mi->mask;314 psImage *Tj = Mj->mask;308 double flux, wt; 309 310 const psImage *Pi = Mi->pixels; 311 const psImage *Pj = Mj->pixels; 312 313 const psImage *Wi = Mi->weight; 314 315 const psImage *Ti = Mi->mask; 316 const psImage *Tj = Mj->mask; 315 317 316 318 Xs = PS_MAX (Pi->col0, Pj->col0); … … 337 339 if (Tj->data.U8[yj][xj]) 338 340 continue; 339 wt = Wi->data.F32[yi][xi]; 340 if (wt > 0) { 341 flux += (Pi->data.F32[yi][xi] * Pj->data.F32[yj][xj]) / wt; 341 342 if (unweighted_sum) { 343 flux += (Pi->data.F32[yi][xi] * Pj->data.F32[yj][xj]); 344 } else { 345 wt = Wi->data.F32[yi][xi]; 346 if (wt > 0) { 347 flux += (Pi->data.F32[yi][xi] * Pj->data.F32[yj][xj]) / wt; 348 } 342 349 } 343 350 } 344 351 } 345 return (flux); 346 } 347 348 float pmSourceCrossWeight (pmSource *Mi, pmSource *Mj) 352 return flux; 353 } 354 355 double pmSourceCrossWeight(const pmSource *Mi, 356 const pmSource *Mj, 357 const bool unweighted_sum) // should the cross product be weighted? 349 358 { 350 359 … … 353 362 int xIs, xJs, yIs, yJs; 354 363 int xIe, yIe; 355 floatflux, wt;356 357 psImage *Pi = Mi->pixels;358 psImage *Pj = Mj->pixels;359 360 psImage *Wi = Mi->weight;361 362 psImage *Ti = Mi->mask;363 psImage *Tj = Mj->mask;364 double flux, wt; 365 366 const psImage *Pi = Mi->pixels; 367 const psImage *Pj = Mj->pixels; 368 369 const psImage *Wi = Mi->weight; 370 371 const psImage *Ti = Mi->mask; 372 const psImage *Tj = Mj->mask; 364 373 365 374 Xs = PS_MAX (Pi->col0, Pj->col0); … … 386 395 if (Tj->data.U8[yj][xj]) 387 396 continue; 388 wt = Wi->data.F32[yi][xi]; 389 if (wt > 0) { 390 flux += 1.0 / wt; 397 398 if (unweighted_sum) { 399 flux++; 400 } else { 401 wt = Wi->data.F32[yi][xi]; 402 if (wt > 0) { 403 flux += 1.0 / wt; 404 } 391 405 } 392 406 } 393 407 } 394 return (flux);395 } 396 408 return flux; 409 } 410
Note:
See TracChangeset
for help on using the changeset viewer.
