- Timestamp:
- Mar 5, 2012, 5:19:48 PM (14 years ago)
- Location:
- branches/meh_branches/ppstack_test
- Files:
-
- 4 edited
-
. (modified) (1 prop)
-
psphot (modified) (1 prop)
-
psphot/src (modified) (2 props)
-
psphot/src/psphotOutput.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/meh_branches/ppstack_test
- Property svn:mergeinfo changed
-
branches/meh_branches/ppstack_test/psphot
- Property svn:mergeinfo changed
-
branches/meh_branches/ppstack_test/psphot/src
- Property svn:ignore
-
old new 22 22 psphotMakePSF 23 23 psphotStack 24 psphotModelTest
-
- Property svn:mergeinfo set to
- Property svn:ignore
-
branches/meh_branches/ppstack_test/psphot/src/psphotOutput.c
r31452 r33415 325 325 psMetadataItemSupplement (&status, header, analysis, "MSKY_NY"); 326 326 327 psMetadataItemSupplement (&status, header, analysis, "MSKY_DEV"); 328 psMetadataItemSupplement (&status, header, analysis, "MSKY_DQ"); 329 327 330 psMetadataItemSupplement (&status, header, analysis, "DETEFF.MAGREF"); 328 331 … … 404 407 return true; 405 408 } 409 410 // for now, let's store the detections on the readout->analysis for each readout 411 bool psphotDumpTest (pmConfig *config, const pmFPAview *view, const char *filerule) 412 { 413 static int npass = 0; 414 char filename[64]; 415 416 // XXX dump tests are disabled unless this is commented out: 417 return true; 418 419 bool status = true; 420 421 int num = psphotFileruleCount(config, filerule); 422 423 snprintf (filename, 64, "testdump.%02d.dat", npass); 424 FILE *f = fopen (filename, "w"); 425 426 // loop over the available readouts 427 for (int i = 0; i < num; i++) { 428 429 // find the currently selected readout 430 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filerule, i); // File of interest 431 psAssert (file, "missing file?"); 432 433 pmReadout *readout = pmFPAviewThisReadout(view, file->fpa); 434 psAssert (readout, "missing readout?"); 435 436 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); 437 psAssert (detections, "missing detections?"); 438 439 psArray *sources = detections->newSources ? detections->newSources : detections->allSources; 440 psAssert (sources, "missing sources?"); 441 442 if (detections->newSources) { 443 fprintf (f, "## --- from new sources ---\n"); 444 } else { 445 fprintf (f, "## --- from all sources ---\n"); 446 } 447 448 for (int i = 0; i < sources->n; i++) { 449 pmSource *source = sources->data[i]; 450 if (!source) continue; 451 452 pmPeak *peak = source->peak; 453 if (!peak) continue; 454 455 // XXX only dump a given region 456 // if (peak->xf < 20) continue; 457 // if (peak->yf < 20) continue; 458 // if (peak->xf > 40) continue; 459 // if (peak->yf > 70) continue; 460 461 float Msum = source->moments ? source->moments->Sum : NAN; 462 float Mx = source->moments ? source->moments->Mx : NAN; 463 float My = source->moments ? source->moments->My : NAN; 464 // float Npix = source->moments ? source->moments->nPixels : NAN; 465 float Io = source->modelPSF ? source->modelPSF->params->data.F32[PM_PAR_I0] : NAN; 466 fprintf (f, "%d %f %f : %f %f : %f %f\n", source->imageID, peak->xf, peak->yf, Mx, My, Msum, Io); 467 } 468 } 469 fclose (f); 470 npass ++; 471 472 return true; 473 } 474 475 # if (0) 406 476 bool psphotDumpTest (pmConfig *config, const pmFPAview *view, const char *filerule, char *filename) { 407 477 … … 446 516 return true; 447 517 } 448 518 # endif
Note:
See TracChangeset
for help on using the changeset viewer.
