Changeset 13064
- Timestamp:
- Apr 27, 2007, 12:14:08 PM (19 years ago)
- Location:
- trunk/psModules/src
- Files:
-
- 14 edited
-
camera/pmFPAMosaic.c (modified) (5 diffs)
-
objects/models/pmModel_GAUSS.c (modified) (3 diffs)
-
objects/models/pmModel_PGAUSS.c (modified) (3 diffs)
-
objects/models/pmModel_QGAUSS.c (modified) (3 diffs)
-
objects/pmPSF.c (modified) (4 diffs)
-
objects/pmPSF.h (modified) (3 diffs)
-
objects/pmPSFtry.c (modified) (4 diffs)
-
objects/pmSourceIO_CMF.c (modified) (3 diffs)
-
objects/pmSourceIO_CMP.c (modified) (5 diffs)
-
objects/pmSourceIO_OBJ.c (modified) (3 diffs)
-
objects/pmSourceIO_PS1_DEV_0.c (modified) (5 diffs)
-
objects/pmSourceIO_SMPDATA.c (modified) (5 diffs)
-
objects/pmSourceIO_SX.c (modified) (3 diffs)
-
objects/pmSourcePlotPSFModel.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPAMosaic.c
r12701 r13064 632 632 if (!mdok || xBin->data.S32[index] == 0) { 633 633 psError(PS_ERR_UNKNOWN, true, "CELL.XBIN for cell is not set.\n"); 634 good =false;634 return false; 635 635 } else if (xBin->data.S32[index] < *xBinMin) { 636 636 *xBinMin = xBin->data.S32[index]; … … 639 639 if (!mdok || yBin->data.S32[index] == 0) { 640 640 psError(PS_ERR_UNKNOWN, true, "CELL.YBIN for cell is not set.\n"); 641 good =false;641 return false; 642 642 } else if (yBin->data.S32[index] < *yBinMin) { 643 643 *yBinMin = yBin->data.S32[index]; … … 648 648 if (!mdok || (xParityCell != 1 && xParityCell != -1)) { 649 649 psError(PS_ERR_UNKNOWN, true, "CELL.XPARITY for cell is not set.\n"); 650 good =false;650 return false; 651 651 } 652 652 int yParityCell = psMetadataLookupS32(&mdok, cell->concepts, "CELL.YPARITY"); 653 653 if (!mdok || (yParityCell != 1 && yParityCell != -1)) { 654 654 psError(PS_ERR_UNKNOWN, true, "CELL.YPARITY for cell is not set.\n"); 655 good =false;655 return false; 656 656 } 657 657 … … 663 663 if (!mdok || (xParityChip != 1 && xParityChip != -1)) { 664 664 psError(PS_ERR_UNKNOWN, true, "CHIP.XPARITY for chip is not set.\n"); 665 good =false;665 return false; 666 666 } 667 667 yParityChip = psMetadataLookupS32(&mdok, chip->concepts, "CHIP.YPARITY"); 668 668 if (!mdok || (yParityChip != 1 && yParityChip != -1)) { 669 669 psError(PS_ERR_UNKNOWN, true, "CHIP.YPARITY for chip is not set.\n"); 670 good =false;670 return false; 671 671 } 672 672 } … … 792 792 continue; 793 793 } 794 allGood |= addCell(images, masks, weights, x0, y0, xBin, yBin, xFlip, yFlip,794 allGood &= addCell(images, masks, weights, x0, y0, xBin, yBin, xFlip, yFlip, 795 795 cell, xBinChip, yBinChip, false, x0Target, y0Target, 796 796 xParityTarget, yParityTarget); -
trunk/psModules/src/objects/models/pmModel_GAUSS.c
r11687 r13064 208 208 psF32 *PAR = params->data.F32; 209 209 210 shape.sx = PAR[PM_PAR_SXX] / sqrt(2.0);211 shape.sy = PAR[PM_PAR_SYY] / sqrt(2.0);210 shape.sx = PAR[PM_PAR_SXX] / M_SQRT2; 211 shape.sy = PAR[PM_PAR_SYY] / M_SQRT2; 212 212 shape.sxy = PAR[PM_PAR_SXY]; 213 213 … … 237 237 return (1.0); 238 238 239 shape.sx = PAR[PM_PAR_SXX] / sqrt(2.0);240 shape.sy = PAR[PM_PAR_SYY] / sqrt(2.0);239 shape.sx = PAR[PM_PAR_SXX] / M_SQRT2; 240 shape.sy = PAR[PM_PAR_SYY] / M_SQRT2; 241 241 shape.sxy = PAR[PM_PAR_SXY]; 242 242 … … 267 267 } 268 268 269 // the 2D model for SXY actually fits SXY / (SXX^-2 + SYY^-2); correct here 270 out[PM_PAR_SXY] = pmPSF_SXYtoModel (out); 269 // the OLD 2D model for SXY actually fitted SXY / (SXX^-2 + SYY^-2); correct here 270 // out[PM_PAR_SXY] = pmPSF_SXYtoModel (out); 271 272 // the 2D PSF model fits polarization terms (E0,E1,E2) 273 // convert to shape terms (SXX,SYY,SXY) 274 // XXX user-defined value for limit? 275 pmPSF_FitToModel (out, 0.1); 271 276 272 277 // apply the model limits here: this truncates excessive extrapolation 278 // XXX do we need to do this still? should we put in asserts to test? 273 279 for (int i = 0; i < psf->params_NEW->n; i++) { 274 280 // apply the limits to all components or just the psf-model parameters? -
trunk/psModules/src/objects/models/pmModel_PGAUSS.c
r11687 r13064 209 209 psF32 *PAR = params->data.F32; 210 210 211 shape.sx = PAR[PM_PAR_SXX] / sqrt(2.0);212 shape.sy = PAR[PM_PAR_SYY] / sqrt(2.0);211 shape.sx = PAR[PM_PAR_SXX] / M_SQRT2; 212 shape.sy = PAR[PM_PAR_SYY] / M_SQRT2; 213 213 shape.sxy = PAR[PM_PAR_SXY]; 214 214 … … 253 253 return (1.0); 254 254 255 shape.sx = PAR[PM_PAR_SXX] / sqrt(2.0);256 shape.sy = PAR[PM_PAR_SYY] / sqrt(2.0);255 shape.sx = PAR[PM_PAR_SXX] / M_SQRT2; 256 shape.sy = PAR[PM_PAR_SYY] / M_SQRT2; 257 257 shape.sxy = PAR[PM_PAR_SXY]; 258 258 … … 288 288 } 289 289 290 // the 2D model for SXY actually fits SXY / (SXX^-2 + SYY^-2); correct here 291 out[PM_PAR_SXY] = pmPSF_SXYtoModel (out); 292 290 // the OLD 2D model for SXY actually fitted SXY / (SXX^-2 + SYY^-2); correct here 291 // out[PM_PAR_SXY] = pmPSF_SXYtoModel (out); 292 293 // the 2D PSF model fits polarization terms (E0,E1,E2) 294 // convert to shape terms (SXX,SYY,SXY) 295 pmPSF_FitToModel (out, 0.1); 296 297 // apply the model limits here: this truncates excessive extrapolation 298 // XXX do we need to do this still? should we put in asserts to test? 299 for (int i = 0; i < psf->params_NEW->n; i++) { 300 // apply the limits to all components or just the psf-model parameters? 301 if (psf->params_NEW->data[i] == NULL) 302 continue; 303 PM_MODEL_LIMITS (PS_MINIMIZE_PARAM_MIN, i, out, NULL); 304 PM_MODEL_LIMITS (PS_MINIMIZE_PARAM_MAX, i, out, NULL); 305 } 293 306 return(true); 294 307 } -
trunk/psModules/src/objects/models/pmModel_QGAUSS.c
r11687 r13064 238 238 psF32 *PAR = params->data.F32; 239 239 240 shape.sx = PAR[PM_PAR_SXX] / sqrt(2.0);241 shape.sy = PAR[PM_PAR_SYY] / sqrt(2.0);240 shape.sx = PAR[PM_PAR_SXX] / M_SQRT2; 241 shape.sy = PAR[PM_PAR_SYY] / M_SQRT2; 242 242 shape.sxy = PAR[PM_PAR_SXY]; 243 243 … … 284 284 return (1.0); 285 285 286 shape.sx = PAR[PM_PAR_SXX] / sqrt(2.0);287 shape.sy = PAR[PM_PAR_SYY] / sqrt(2.0);286 shape.sx = PAR[PM_PAR_SXX] / M_SQRT2; 287 shape.sy = PAR[PM_PAR_SYY] / M_SQRT2; 288 288 shape.sxy = PAR[PM_PAR_SXY]; 289 289 … … 345 345 } 346 346 347 // the 2D model for SXY actually fits SXY / (SXX^-2 + SYY^-2); correct here 348 out[PM_PAR_SXY] = pmPSF_SXYtoModel (out); 347 // the OLD 2D model for SXY actually fitted SXY / (SXX^-2 + SYY^-2); correct here 348 // out[PM_PAR_SXY] = pmPSF_SXYtoModel (out); 349 350 // the 2D PSF model fits polarization terms (E0,E1,E2) 351 // convert to shape terms (SXX,SYY,SXY) 352 pmPSF_FitToModel (out, 0.1); 349 353 350 354 // apply the model limits here: this truncates excessive extrapolation 355 // XXX do we need to do this still? should we put in asserts to test? 351 356 for (int i = 0; i < psf->params_NEW->n; i++) { 352 357 // apply the limits to all components or just the psf-model parameters? -
trunk/psModules/src/objects/pmPSF.c
r13034 r13064 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.2 1$ $Name: not supported by cvs2svn $9 * @date $Date: 2007-04-2 6 01:20:29$8 * @version $Revision: 1.22 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-04-27 22:14:08 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 236 236 } 237 237 238 // New Concept: the PSF modelling function fits the polarization terms e0, e1, e2: 239 240 // convert the parameters used in the fitted source model 241 // to the parameters used in the 2D PSF model 242 bool pmPSF_FitToModel (psF32 *fittedPar, float minMinorAxis) 243 { 244 psEllipsePol pol; 245 246 pol.e0 = fittedPar[PM_PAR_E0]; 247 pol.e1 = fittedPar[PM_PAR_E1]; 248 pol.e2 = fittedPar[PM_PAR_E2]; 249 250 psEllipseAxes axes = psEllipsePolToAxes (pol, minMinorAxis); 251 psEllipseShape shape = psEllipseAxesToShape (axes); 252 253 fittedPar[PM_PAR_SXX] = shape.sx * M_SQRT2; 254 fittedPar[PM_PAR_SYY] = shape.sy * M_SQRT2; 255 fittedPar[PM_PAR_SXY] = shape.sxy; 256 257 return true; 258 } 259 260 // convert the PSF parameters used in the 2D PSF model fit into the 261 // parameters used in the source model 262 psEllipsePol pmPSF_ModelToFit (psF32 *modelPar) 263 { 264 psEllipseShape shape; 265 266 shape.sx = modelPar[PM_PAR_SXX] / M_SQRT2; 267 shape.sy = modelPar[PM_PAR_SYY] / M_SQRT2; 268 shape.sxy = modelPar[PM_PAR_SXY]; 269 270 psEllipsePol pol = psEllipseShapeToPol (shape); 271 272 return pol; 273 } 274 275 // convert the parameters used in the fitted source model to the psEllipseAxes representation 276 // (major,minor,theta) 277 psEllipseAxes pmPSF_ModelToAxes (psF32 *modelPar, double maxAR) 278 { 279 psEllipseShape shape; 280 psEllipseAxes axes; 281 282 shape.sx = modelPar[PM_PAR_SXX] / M_SQRT2; 283 shape.sy = modelPar[PM_PAR_SYY] / M_SQRT2; 284 shape.sxy = modelPar[PM_PAR_SXY]; 285 286 if ((shape.sx == 0) || (shape.sy == 0)) { 287 axes.major = 0.0; 288 axes.minor = 0.0; 289 axes.theta = 0.0; 290 } else { 291 // XXX this is not really consistent with the model fit range above 292 axes = psEllipseShapeToAxes (shape, maxAR); 293 } 294 295 return axes; 296 } 297 298 // convert the psEllipseAxes representation (major,minor,theta) to the parameters used in the 299 // fitted source model 300 bool pmPSF_AxesToModel (psF32 *modelPar, psEllipseAxes axes) 301 { 302 if ((axes.major <= 0) || (axes.minor <= 0)) { 303 modelPar[PM_PAR_SXX] = 0.0; 304 modelPar[PM_PAR_SYY] = 0.0; 305 modelPar[PM_PAR_SXY] = 0.0; 306 return true; 307 } 308 309 psEllipseShape shape = psEllipseAxesToShape (axes); 310 311 modelPar[PM_PAR_SXX] = shape.sx * M_SQRT2; 312 modelPar[PM_PAR_SYY] = shape.sy * M_SQRT2; 313 modelPar[PM_PAR_SXY] = shape.sxy; 314 315 return true; 316 } 317 238 318 // generate a psf model of the requested type, with fixed shape 239 319 pmPSF *pmPSFBuildSimple (char *typeName, float sxx, float syy, float sxy, ...) … … 247 327 pmPSF *psf = pmPSFAlloc (type, true, psfTrend); 248 328 329 psVector *par = psVectorAlloc (psf->params_NEW->n, PS_TYPE_F32); 330 par->data.F32[PM_PAR_SXX] = sxx; 331 par->data.F32[PM_PAR_SYY] = syy; 332 par->data.F32[PM_PAR_SXY] = sxy; 333 334 psEllipsePol pol = pmPSF_ModelToFit(par->data.F32); 335 249 336 // set the psf shape parameters 250 psPolynomial2D *poly = psf->params_NEW->data[PM_PAR_SXX]; 251 poly->coeff[0][0] = M_SQRT2*sxx; 252 253 poly = psf->params_NEW->data[PM_PAR_SYY]; 254 poly->coeff[0][0] = M_SQRT2*syy; 255 256 poly = psf->params_NEW->data[PM_PAR_SXY]; 257 poly->coeff[0][0] = sxy; 337 psPolynomial2D *poly = NULL; 338 poly = psf->params_NEW->data[PM_PAR_E0]; 339 poly->coeff[0][0] = pol.e0; 340 341 poly = psf->params_NEW->data[PM_PAR_E1]; 342 poly->coeff[0][0] = pol.e1; 343 344 poly = psf->params_NEW->data[PM_PAR_E2]; 345 poly->coeff[0][0] = pol.e2; 258 346 259 347 for (int i = PM_PAR_SXY + 1; i < psf->params_NEW->n; i++) { … … 263 351 va_end(ap); 264 352 353 psFree (par); 265 354 psFree (psfTrend); 266 355 return psf; -
trunk/psModules/src/objects/pmPSF.h
r12949 r13064 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $9 * @date $Date: 2007-04-2 1 19:47:14$8 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-04-27 22:14:08 $ 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 11 11 */ … … 64 64 pmPSF; 65 65 66 # define PM_PAR_E0 PM_PAR_SXX 67 # define PM_PAR_E1 PM_PAR_SYY 68 # define PM_PAR_E2 PM_PAR_SXY 69 66 70 /** 67 71 * … … 99 103 pmPSF *pmPSFBuildSimple (char *typeName, float sxx, float syy, float sxy, ...); 100 104 105 bool pmPSF_AxesToModel (psF32 *modelPar, psEllipseAxes axes); 106 psEllipseAxes pmPSF_ModelToAxes (psF32 *modelPar, double maxAR); 107 bool pmPSF_FitToModel (psF32 *fittedPar, float minMinorAxis); 108 psEllipsePol pmPSF_ModelToFit (psF32 *modelPar); 109 101 110 /// @} 102 111 # endif -
trunk/psModules/src/objects/pmPSFtry.c
r13034 r13064 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1.3 6$ $Name: not supported by cvs2svn $8 * @date $Date: 2007-04-2 6 01:20:29$7 * @version $Revision: 1.37 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-04-27 22:14:08 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 352 352 x->data.F64[i] = source->modelEXT->params->data.F32[PM_PAR_XPOS]; 353 353 y->data.F64[i] = source->modelEXT->params->data.F32[PM_PAR_YPOS]; 354 355 // weight by the error on the source flux 356 if (dz) { 357 dz->data.F64[i] = source->modelEXT->dparams->data.F32[PM_PAR_I0]; 358 } 354 359 } 355 360 … … 360 365 psStats *stats = psStatsAlloc (PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV); 361 366 362 // skip the unfitted parameters (X, Y, Io, Sky) 367 // The shape parameters (SXX, SXY, SYY) are strongly coupled. We have to handle them very 368 // carefully. First, we convert them to the Ellipse Polarization terms (E0, E1, E2) for 369 // each source and fit this set of parameters. These values are less tightly coupled, but 370 // are still inter-related. The fitted values do a good job of constraining the major axis 371 // and the position angle, but the minor axis is weakly measured. When we apply the PSF 372 // model to construct a source model, we convert the fitted values of E0,E1,E2 to the shape 373 // parameters, with the constraint that the minor axis must be greater than a minimum 374 // threshold. 375 376 // convert the measured source shape paramters to polarization terms 377 psVector *e0 = psVectorAlloc (psfTry->sources->n, PS_TYPE_F64); 378 psVector *e1 = psVectorAlloc (psfTry->sources->n, PS_TYPE_F64); 379 psVector *e2 = psVectorAlloc (psfTry->sources->n, PS_TYPE_F64); 380 for (int i = 0; i < psfTry->sources->n; i++) { 381 pmSource *source = psfTry->sources->data[i]; 382 if (source->modelEXT == NULL) continue; 383 384 psEllipsePol pol = pmPSF_ModelToFit (source->modelEXT->params->data.F32); 385 386 e0->data.F64[i] = pol.e0; 387 e1->data.F64[i] = pol.e1; 388 e2->data.F64[i] = pol.e2; 389 } 390 391 // we run 'clipIter' cycles clipping in each of x and y, with only one iteration each. 392 // This way, the parameters masked by one of the fits will be applied to the others 393 for (int i = 0; i < stats->clipIter; i++) { 394 psVectorClipFitPolynomial2D (psf->params_NEW->data[PM_PAR_E0], stats, psfTry->mask, 0xff, e0, dz, x, y); 395 psVectorClipFitPolynomial2D (psf->params_NEW->data[PM_PAR_E1], stats, psfTry->mask, 0xff, e1, dz, x, y); 396 psVectorClipFitPolynomial2D (psf->params_NEW->data[PM_PAR_E2], stats, psfTry->mask, 0xff, e2, dz, x, y); 397 } 398 399 // skip the unfitted parameters (X, Y, Io, Sky) and the shape parameters (SXX, SYY, SXY) 363 400 for (int i = 0; i < psf->params_NEW->n; i++) { 364 if (i == PM_PAR_SKY) 365 continue; 366 if (i == PM_PAR_I0) 367 continue; 368 if (i == PM_PAR_XPOS) 369 continue; 370 if (i == PM_PAR_YPOS) 371 continue; 401 switch (i) { 402 case PM_PAR_SKY: 403 case PM_PAR_I0: 404 case PM_PAR_XPOS: 405 case PM_PAR_YPOS: 406 case PM_PAR_SXX: 407 case PM_PAR_SYY: 408 case PM_PAR_SXY: 409 continue; 410 default: 411 break; 412 } 372 413 373 414 // select the per-object fitted data for this parameter … … 376 417 if (source->modelEXT == NULL) 377 418 continue; 378 379 419 z->data.F64[j] = source->modelEXT->params->data.F32[i]; 380 if (applyWeight) {381 dz->data.F64[j] = source->modelEXT->dparams->data.F32[i];382 }383 384 // for SXY, we actually fit SXY / (SXX^-2 + SYY^-2)385 if (i == PM_PAR_SXY) {386 z->data.F64[j] = pmPSF_SXYfromModel (source->modelEXT->params->data.F32);387 }388 420 } 389 421 390 422 // fit the collection of measured parameters to the PSF 2D model 391 423 // the mask is carried from previous steps and updated with this operation 392 // the weight is either the parametererror or NULL, depending on 'applyWeights'424 // the weight is either the flux error or NULL, depending on 'applyWeights' 393 425 if (!psVectorClipFitPolynomial2D(psf->params_NEW->data[i], stats, psfTry->mask, 0xff, z, NULL, x, y)) { 394 426 psError(PS_ERR_UNKNOWN, false, "failed to build psf model for parameter %d", i); -
trunk/psModules/src/objects/pmSourceIO_CMF.c
r13034 r13064 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.2 0$ $Name: not supported by cvs2svn $6 * @date $Date: 2007-04-2 6 01:20:29$5 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-04-27 22:14:08 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 68 68 lsky = (source->sky < 1.0) ? 0.0 : log10(source->sky); 69 69 70 shape.sx = PAR[PM_PAR_SXX]; 71 shape.sy = PAR[PM_PAR_SYY]; 72 shape.sxy = PAR[PM_PAR_SXY]; 73 axes = psEllipseShapeToAxes (shape, 20.0); 70 axes = pmPSF_ModelToAxes (PAR, 20.0); 74 71 75 72 row = psMetadataAlloc (); … … 158 155 axes.theta = psMetadataLookupF32 (&status, row, "THETA"); 159 156 160 shape = psEllipseAxesToShape (axes); 161 162 PAR[PM_PAR_SXX] = shape.sx; 163 PAR[PM_PAR_SYY] = shape.sy; 164 PAR[PM_PAR_SXY] = shape.sxy; 157 pmPSF_AxesToModel (PAR, axes); 165 158 166 159 source->psfMag = psMetadataLookupF32 (&status, row, "MAG_RAW") - ZERO_POINT; -
trunk/psModules/src/objects/pmSourceIO_CMP.c
r13034 r13064 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.2 7$ $Name: not supported by cvs2svn $6 * @date $Date: 2007-04-2 6 01:20:29$5 * @version $Revision: 1.28 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-04-27 22:14:08 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 53 53 float lsky = 0; 54 54 bool status; 55 psEllipseShape shape;56 55 psEllipseAxes axes; 57 56 … … 119 118 lsky = (source->sky < 1.0) ? 0.0 : log10(source->sky); 120 119 121 shape.sx = PAR[PM_PAR_SXX]; 122 shape.sy = PAR[PM_PAR_SYY]; 123 shape.sxy = PAR[PM_PAR_SXY]; 124 axes = psEllipseShapeToAxes (shape, 20.0); 120 axes = pmPSF_ModelToAxes (PAR, 20.0); 125 121 126 122 float errMag = isfinite(source->errMag) ? source->errMag : 999; … … 155 151 int Ninstar; 156 152 psF32 *PAR, *dPAR; 157 psEllipseShape shape;158 153 psEllipseAxes axes; 159 154 … … 274 269 goto skip_source; 275 270 276 shape = psEllipseAxesToShape (axes); 277 278 PAR[PM_PAR_SXX] = shape.sx; 279 PAR[PM_PAR_SYY] = shape.sy; 280 PAR[PM_PAR_SXY] = shape.sxy; 271 pmPSF_AxesToModel (PAR, axes); 281 272 282 273 psArrayAdd (sources, 100, source); -
trunk/psModules/src/objects/pmSourceIO_OBJ.c
r13034 r13064 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $6 * @date $Date: 2007-04-2 6 01:20:29$5 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-04-27 22:14:08 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 45 45 psF32 *PAR, *dPAR; 46 46 float dmag, apResid; 47 psEllipseShape shape;48 47 psEllipseAxes axes; 49 48 … … 78 77 } 79 78 80 shape.sx = PAR[PM_PAR_SXX]; 81 shape.sy = PAR[PM_PAR_SYY]; 82 shape.sxy = PAR[PM_PAR_SXY]; 83 axes = psEllipseShapeToAxes (shape, 20.0); 79 axes = pmPSF_ModelToAxes (PAR, 20.0); 84 80 85 81 psLineInit (line); -
trunk/psModules/src/objects/pmSourceIO_PS1_DEV_0.c
r13034 r13064 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $6 * @date $Date: 2007-04-2 6 01:20:29$5 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-04-27 22:14:08 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 53 53 int i; 54 54 psF32 *PAR, *dPAR; 55 psEllipseShape shape;56 55 psEllipseAxes axes; 57 56 psF32 xPos, yPos; … … 75 74 yErr = dPAR[PM_PAR_YPOS]; 76 75 77 shape.sx = PAR[PM_PAR_SXX]; 78 shape.sy = PAR[PM_PAR_SYY]; 79 shape.sxy = PAR[PM_PAR_SXY]; 80 if ((shape.sx == 0) || (shape.sy == 0)) { 81 axes.major = 0.0; 82 axes.minor = 0.0; 83 axes.theta = 0.0; 84 } else { 85 axes = psEllipseShapeToAxes (shape, 20.0); 86 } 76 axes = pmPSF_ModelToAxes (PAR, 20.0); 87 77 } else { 88 78 xPos = source->peak->xf; … … 159 149 bool status; 160 150 psF32 *PAR, *dPAR; 161 psEllipseShape shape;162 151 psEllipseAxes axes; 163 152 … … 203 192 source->errMag = psMetadataLookupF32 (&status, row, "PSF_INST_MAG_ERR"); 204 193 205 bool skip = false; 206 skip |= (axes.major <= 0); 207 skip |= (axes.minor <= 0); 208 if (!skip) { 209 shape = psEllipseAxesToShape (axes); 210 PAR[PM_PAR_SXX] = shape.sx; 211 PAR[PM_PAR_SYY] = shape.sy; 212 PAR[PM_PAR_SXY] = shape.sxy; 213 } else { 214 PAR[PM_PAR_SXX] = 0.0; 215 PAR[PM_PAR_SYY] = 0.0; 216 PAR[PM_PAR_SXY] = 0.0; 217 } 194 pmPSF_AxesToModel (PAR, axes); 218 195 219 196 float lflux = psMetadataLookupF32 (&status, row, "PEAK_FLUX_AS_MAG"); -
trunk/psModules/src/objects/pmSourceIO_SMPDATA.c
r13034 r13064 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $6 * @date $Date: 2007-04-2 6 01:20:29$5 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-04-27 22:14:08 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 49 49 psF32 *PAR, *dPAR; 50 50 bool status; 51 psEllipseShape shape;52 51 psEllipseAxes axes; 53 52 psF32 xPos, yPos; … … 74 73 lsky = (source->sky < 1.0) ? 0.0 : log10(source->sky); 75 74 76 shape.sx = PAR[PM_PAR_SXX]; 77 shape.sy = PAR[PM_PAR_SYY]; 78 shape.sxy = PAR[PM_PAR_SXY]; 79 if ((shape.sx == 0) || (shape.sy == 0)) { 80 axes.major = 0.0; 81 axes.minor = 0.0; 82 axes.theta = 0.0; 83 } else { 84 axes = psEllipseShapeToAxes (shape, 20.0); 85 } 75 axes = pmPSF_ModelToAxes (PAR, 20.0); 76 86 77 } else { 87 78 xPos = source->peak->xf; … … 134 125 bool status; 135 126 psF32 *PAR, *dPAR; 136 psEllipseShape shape;137 127 psEllipseAxes axes; 138 128 float lsky; … … 177 167 axes.theta = psMetadataLookupF32 (&status, row, "THETA"); 178 168 179 bool skip = false; 180 skip |= (axes.major <= 0); 181 skip |= (axes.minor <= 0); 182 if (!skip) { 183 shape = psEllipseAxesToShape (axes); 184 PAR[PM_PAR_SXX] = shape.sx; 185 PAR[PM_PAR_SYY] = shape.sy; 186 PAR[PM_PAR_SXY] = shape.sxy; 187 } else { 188 PAR[PM_PAR_SXX] = 0.0; 189 PAR[PM_PAR_SYY] = 0.0; 190 PAR[PM_PAR_SXY] = 0.0; 191 } 169 pmPSF_AxesToModel (PAR, axes); 192 170 193 171 source->psfMag = psMetadataLookupF32 (&status, row, "MAG_RAW") - ZERO_POINT; -
trunk/psModules/src/objects/pmSourceIO_SX.c
r13034 r13064 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $6 * @date $Date: 2007-04-2 6 01:20:29$5 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-04-27 22:14:08 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 43 43 44 44 psF32 *PAR, *dPAR; 45 psEllipseShape shape;46 45 psEllipseAxes axes; 47 46 … … 68 67 // pmSourceSextractType (source, &type, &flags); 69 68 70 shape.sx = PAR[PM_PAR_SXX]; 71 shape.sy = PAR[PM_PAR_SYY]; 72 shape.sxy = PAR[PM_PAR_SXY]; 73 axes = psEllipseShapeToAxes (shape, 20.0); 69 axes = pmPSF_ModelToAxes (PAR, 20.0); 74 70 75 71 psLineInit (line); -
trunk/psModules/src/objects/pmSourcePlotPSFModel.c
r12949 r13064 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $8 * @date $Date: 2007-04-2 1 19:47:14$7 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-04-27 22:14:08 $ 9 9 * 10 10 * Copyright 2006 IfA, University of Hawaii … … 120 120 moments.xy = source->moments->Sxy; 121 121 122 psEllipseShape shape;123 shape.sx = PAR[PM_PAR_SXX] / sqrt(2.0);124 shape.sy = PAR[PM_PAR_SYY] / sqrt(2.0);125 shape.sxy = PAR[PM_PAR_SXY];126 127 122 // force the axis ratio to be < 20.0 128 123 psEllipseAxes axes_mnt = psEllipseMomentsToAxes (moments, 20.0); 129 psEllipseAxes axes_psf = p sEllipseShapeToAxes (shape, 20.0);124 psEllipseAxes axes_psf = pmPSF_ModelToAxes (PAR, 20.0); 130 125 131 126 // moments major axis
Note:
See TracChangeset
for help on using the changeset viewer.
