Changeset 10075
- Timestamp:
- Nov 17, 2006, 9:31:44 PM (20 years ago)
- Location:
- trunk/psModules
- Files:
-
- 1 added
- 5 edited
-
src/camera/pmFPAMaskWeight.c (modified) (1 diff)
-
src/objects/pmPSFtry.c (modified) (4 diffs)
-
src/objects/pmSource.c (modified) (16 diffs)
-
src/objects/pmSourceFitModel.c (modified) (5 diffs)
-
src/objects/pmSourceIO_RAW.c (modified) (2 diffs)
-
test/objects/tap_pmSourceFitModel.c (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPAMaskWeight.c
r9830 r10075 210 210 psImage *image = readout->image; // The image pixels 211 211 readout->weight = (psImage*)psBinaryOp(readout->weight, image, "/", psScalarAlloc(gain, PS_TYPE_F32)); 212 213 // a negative weight is non-sensical. if the image value drops below 1, the weight must be 1. 214 readout->weight = (psImage*)psUnaryOp(readout->weight, readout->weight, "abs"); 215 readout->weight = (psImage*)psBinaryOp(readout->weight, readout->weight, "max", psScalarAlloc(1, PS_TYPE_F32)); 216 212 217 readout->weight = (psImage*)psBinaryOp(readout->weight, readout->weight, "+", 213 218 psScalarAlloc(readnoise*readnoise/gain/gain, PS_TYPE_F32)); -
trunk/psModules/src/objects/pmPSFtry.c
r10011 r10075 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1.2 6$ $Name: not supported by cvs2svn $8 * @date $Date: 2006-11-1 6 01:45:50$7 * @version $Revision: 1.27 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2006-11-18 07:31:44 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 168 168 psImageKeepCircle (source->mask, x, y, RADIUS, "OR", PM_MASK_MARK); 169 169 status = pmSourceFitModel (source, source->modelPSF, PM_SOURCE_FIT_PSF); 170 // pmModelSub (source->pixels, source->mask, source->modelPSF, false, false); 170 171 psImageKeepCircle (source->mask, x, y, RADIUS, "AND", PS_NOT_U8(PM_MASK_MARK)); 171 172 … … 291 292 292 293 // XXX test dump of fitted model (dump when tracing?) 293 if ( 0) {294 if (1) { 294 295 FILE *f = fopen ("resid.dat", "w"); 295 296 psVector *apfit = psPolynomial1DEvalVector (poly, r2rflux); … … 403 404 404 405 // XXX test dump of star parameters vs position (compare with fitted values) 405 if ( 0) {406 if (1) { 406 407 FILE *f = fopen ("params.dat", "w"); 407 408 -
trunk/psModules/src/objects/pmSource.c
r10049 r10075 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1.1 8$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-11-1 7 23:01:30$8 * @version $Revision: 1.19 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-11-18 07:31:44 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 31 31 static void sourceFree(pmSource *tmp) 32 32 { 33 psTrace( __func__, 5, "---- begin ----\n");33 psTrace("psModules.objects", 5, "---- begin ----\n"); 34 34 psFree(tmp->peak); 35 35 psFree(tmp->pixels); … … 40 40 psFree(tmp->modelEXT); 41 41 psFree(tmp->blends); 42 psTrace( __func__, 5, "---- end ----\n");42 psTrace("psModules.objects", 5, "---- end ----\n"); 43 43 } 44 44 … … 65 65 pmSource *pmSourceAlloc() 66 66 { 67 psTrace( __func__, 5, "---- begin ----\n");67 psTrace("psModules.objects", 5, "---- begin ----\n"); 68 68 static int id = 1; 69 69 pmSource *source = (pmSource *) psAlloc(sizeof(pmSource)); … … 90 90 source->pixWeight = NAN; 91 91 92 psTrace( __func__, 5, "---- end ----\n");92 psTrace("psModules.objects", 5, "---- end ----\n"); 93 93 return(source); 94 94 } … … 205 205 pmPSFClump pmSourcePSFClump(psArray *sources, psMetadata *recipe) 206 206 { 207 psTrace( __func__, 5, "---- begin ----\n");207 psTrace("psModules.objects", 5, "---- begin ----\n"); 208 208 209 209 # define NPIX 10 … … 291 291 stats = psImageStats (stats, splane, NULL, 0); 292 292 peaks = pmFindImagePeaks (splane, stats[0].max / 2); 293 psTrace ( __func__, 2, "clump threshold is %f\n", stats[0].max/2);293 psTrace ("psModules.objects", 2, "clump threshold is %f\n", stats[0].max/2); 294 294 295 295 const bool keep_psf_clump = psMetadataLookupBool(NULL, recipe, "KEEP_PSF_CLUMP"); … … 323 323 psArraySort (peaks, pmPeaksCompareDescend); 324 324 clump = peaks->data[0]; 325 psTrace ( __func__, 2, "clump is at %d, %d (%f)\n", clump->x, clump->y, clump->counts);325 psTrace ("psModules.objects", 2, "clump is at %d, %d (%f)\n", clump->x, clump->y, clump->counts); 326 326 327 327 // define section window for clump … … 369 369 psfClump.dY = stats->clippedStdev; 370 370 371 psTrace ( __func__, 2, "clump X, Y: %f, %f\n", psfClump.X, psfClump.Y);372 psTrace ( __func__, 2, "clump DX, DY: %f, %f\n", psfClump.dX, psfClump.dY);371 psTrace ("psModules.objects", 2, "clump X, Y: %f, %f\n", psfClump.X, psfClump.Y); 372 psTrace ("psModules.objects", 2, "clump DX, DY: %f, %f\n", psfClump.dX, psfClump.dY); 373 373 // these values should be pushed on the recipe somewhere 374 374 … … 379 379 } 380 380 381 psTrace( __func__, 5, "---- end ----\n");381 psTrace("psModules.objects", 5, "---- end ----\n"); 382 382 return (psfClump); 383 383 } … … 391 391 bool pmSourceRoughClass(psArray *sources, psMetadata *recipe, pmPSFClump clump) 392 392 { 393 psTrace( __func__, 5, "---- begin ----");393 psTrace("psModules.objects", 5, "---- begin ----"); 394 394 395 395 psBool rc = true; … … 498 498 psFree (starsn); 499 499 500 psTrace ( __func__, 2, "Nstar: %3d\n", Nstar);501 psTrace ( __func__, 2, "Npsf: %3d\n", Npsf);502 psTrace ( __func__, 2, "Next: %3d\n", Next);503 psTrace ( __func__, 2, "Nsatstar: %3d\n", Nsatstar);504 psTrace ( __func__, 2, "Nsat: %3d\n", Nsat);505 psTrace ( __func__, 2, "Ncr: %3d\n", Ncr);506 507 psTrace( __func__, 5, "---- end ----\n");500 psTrace ("psModules.objects", 2, "Nstar: %3d\n", Nstar); 501 psTrace ("psModules.objects", 2, "Npsf: %3d\n", Npsf); 502 psTrace ("psModules.objects", 2, "Next: %3d\n", Next); 503 psTrace ("psModules.objects", 2, "Nsatstar: %3d\n", Nsatstar); 504 psTrace ("psModules.objects", 2, "Nsat: %3d\n", Nsat); 505 psTrace ("psModules.objects", 2, "Ncr: %3d\n", Ncr); 506 507 psTrace("psModules.objects", 5, "---- end ----\n"); 508 508 return(rc); 509 509 } … … 531 531 psF32 radius) 532 532 { 533 psTrace( __func__, 5, "---- begin ----\n");533 psTrace("psModules.objects", 5, "---- begin ----\n"); 534 534 PS_ASSERT_PTR_NON_NULL(source, false); 535 535 PS_ASSERT_PTR_NON_NULL(source->peak, false); … … 637 637 // XXX EAM - the limit is a bit arbitrary. make it user defined? 638 638 if ((numPixels < 0.75*R2) || (Sum <= 0)) { 639 psTrace ( __func__, 3, "no valid pixels for source\n");640 psTrace( __func__, 5, "---- end (false) ----\n");639 psTrace ("psModules.objects", 3, "no valid pixels for source\n"); 640 psTrace("psModules.objects", 5, "---- end (false) ----\n"); 641 641 return (false); 642 642 } 643 643 644 psTrace ( __func__, 4, "sky: %f Sum: %f X1: %f Y1: %f X2: %f Y2: %f XY: %f Npix: %d\n",644 psTrace ("psModules.objects", 4, "sky: %f Sum: %f X1: %f Y1: %f X2: %f Y2: %f XY: %f Npix: %d\n", 645 645 sky, Sum, X1, Y1, X2, Y2, XY, numPixels); 646 646 … … 653 653 y = Y1/Sum; 654 654 if ((fabs(x) > radius) || (fabs(y) > radius)) { 655 psTrace ( __func__, 3, "large centroid swing; invalid peak %d, %d\n",655 psTrace ("psModules.objects", 3, "large centroid swing; invalid peak %d, %d\n", 656 656 source->peak->x, source->peak->y); 657 psTrace( __func__, 5, "---- end(false) ----\n");657 psTrace("psModules.objects", 5, "---- end(false) ----\n"); 658 658 return (false); 659 659 } … … 673 673 source->moments->Sy = sqrt(PS_MAX(Y2/Sum - PS_SQR(y), 0)); 674 674 675 psTrace ( __func__, 4,675 psTrace ("psModules.objects", 4, 676 676 "sky: %f Sum: %f x: %f y: %f Sx: %f Sy: %f Sxy: %f\n", 677 677 sky, Sum, source->moments->x, source->moments->y, 678 678 source->moments->Sx, source->moments->Sy, source->moments->Sxy); 679 679 680 psTrace( __func__, 5, "---- end ----\n");680 psTrace("psModules.objects", 5, "---- end ----\n"); 681 681 return(true); 682 682 } -
trunk/psModules/src/objects/pmSourceFitModel.c
r9730 r10075 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-1 0-24 22:55:05$8 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-11-18 07:31:44 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 51 51 pmSourceFitMode mode) 52 52 { 53 psTrace("psModules.objects", 3, "---- %s() begin ----\n", __func__);53 psTrace("psModules.objects", 5, "---- %s() begin ----\n", __func__); 54 54 PS_ASSERT_PTR_NON_NULL(source, false); 55 55 PS_ASSERT_PTR_NON_NULL(source->moments, false); … … 163 163 164 164 if (nPix < nParams + 1) { 165 psTrace (" .pmObjects.pmSourceFitModel", 4, "insufficient valid pixels\n");166 psTrace ("psModules.objects", 3, "---- %s(false) end ----\n", __func__);165 psTrace ("psModules.objects", 4, "insufficient valid pixels\n"); 166 psTrace ("psModules.objects", 5, "---- %s(false) end ----\n", __func__); 167 167 model->status = PM_MODEL_BADARGS; 168 168 psFree (x); … … 189 189 psImage *covar = psImageAlloc (params->n, params->n, PS_TYPE_F64); 190 190 191 psTrace ( ".pmObjects.pmSourceFitModel", 5, "fitting function\n");191 psTrace (__func__, 5, "fitting function\n"); 192 192 193 193 fitStatus = psMinimizeLMChi2(myMin, covar, params, constrain, x, y, yErr, modelFunc); 194 194 for (int i = 0; i < dparams->n; i++) { 195 psTrace ("psModules.objects", 4, "%f ", params->data.F32[i]); 195 196 if ((paramMask != NULL) && paramMask->data.U8[i]) 196 197 continue; 197 198 dparams->data.F32[i] = sqrt(covar->data.F64[i][i]); 198 199 } 200 psTrace ("psModules.objects", 4, "niter: %d, chisq: %f", myMin->iter, myMin->value); 199 201 200 202 // save the resulting chisq, nDOF, nIter … … 245 247 246 248 rc = (onPic && fitStatus); 247 psTrace("psModules.objects", 3, "---- %s(%d) end ----\n", __func__, rc);249 psTrace("psModules.objects", 5, "---- %s(%d) end ----\n", __func__, rc); 248 250 return(rc); 249 251 } -
trunk/psModules/src/objects/pmSourceIO_RAW.c
r9810 r10075 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $6 * @date $Date: 2006-1 0-31 19:38:44 $5 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2006-11-18 07:31:44 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 267 267 if (peak == NULL) 268 268 continue; 269 fprintf (f, "%5d %5d %7.1f \n",270 peak->x, peak->y, peak->counts );271 } 272 fclose (f); 273 return true; 274 } 275 269 fprintf (f, "%5d %5d %7.1f %7.2f %7.2f\n", 270 peak->x, peak->y, peak->counts, peak->xf, peak->yf); 271 } 272 fclose (f); 273 return true; 274 } 275
Note:
See TracChangeset
for help on using the changeset viewer.
