Changeset 37825 for branches/eam_branches/ipp-pv3-20140717-merge
- Timestamp:
- Jan 12, 2015, 12:34:04 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-pv3-20140717-merge/psphot/src
- Files:
-
- 20 edited
- 2 copied
-
Makefile.am (modified) (2 diffs)
-
psphot.h (modified) (4 diffs)
-
psphotChipParams.c (copied) (copied from trunk/psphot/src/psphotChipParams.c )
-
psphotChooseAnalysisOptions.c (modified) (1 diff)
-
psphotChoosePSF.c (modified) (4 diffs)
-
psphotCleanup.c (modified) (1 diff)
-
psphotEfficiency.c (modified) (1 diff)
-
psphotExtendedSourceAnalysis.c (modified) (1 diff)
-
psphotExtendedSourceFits.c (modified) (1 diff)
-
psphotFitSourcesLinear.c (modified) (1 diff)
-
psphotFullForceReadout.c (modified) (2 diffs)
-
psphotGalaxyParams.c (copied) (copied from trunk/psphot/src/psphotGalaxyParams.c )
-
psphotMagnitudes.c (modified) (3 diffs)
-
psphotOutput.c (modified) (2 diffs)
-
psphotPetrosianAnalysis.c (modified) (1 diff)
-
psphotReadout.c (modified) (1 diff)
-
psphotReadoutCleanup.c (modified) (1 diff)
-
psphotSetNFrames.c (modified) (1 diff)
-
psphotSetThreads.c (modified) (1 diff)
-
psphotSourceStats.c (modified) (3 diffs)
-
psphotStackParseCamera.c (modified) (2 diffs)
-
psphotStackReadout.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-pv3-20140717-merge/psphot/src/Makefile.am
r36623 r37825 97 97 # generalized forced photometry (including Kron, Petro, and Models) of specified positions given a specified psf 98 98 psphotFullForce_SOURCES = \ 99 psphotFullForce.c \100 psphotFullForceArguments.c \99 psphotFullForce.c \ 100 psphotFullForceArguments.c \ 101 101 psphotParseCamera.c \ 102 102 psphotImageLoop.c \ … … 259 259 psphotEfficiency.c \ 260 260 psphotSetNFrames.c \ 261 psphotSourceMemory.c 261 psphotSourceMemory.c \ 262 psphotChipParams.c \ 263 psphotGalaxyParams.c 262 264 263 265 # not currently used -
branches/eam_branches/ipp-pv3-20140717-merge/psphot/src/psphot.h
r36757 r37825 138 138 bool psphotExtendedSourceFits_Threaded (psThreadJob *job); 139 139 140 bool psphotGalaxyParams (pmConfig *config, const pmFPAview *view, const char *filerule); 141 bool psphotGalaxyParamsReadout (pmConfig *config, const pmFPAview *view, const char *filerule, int index, psMetadata *recipe); 142 bool psphotGalaxyParams_Threaded (psThreadJob *job); 143 140 144 bool psphotApResid (pmConfig *config, const pmFPAview *view, const char *filerule); 141 145 bool psphotApResidReadout (pmConfig *config, const pmFPAview *view, const char *filerule, int index, psMetadata *recipe); 142 146 143 147 bool psphotMagnitudes (pmConfig *config, const pmFPAview *view, const char *filerule); 144 bool psphotMagnitudesReadout(pmConfig *config, psMetadata *recipe, const pmFPAview *view, pmReadout *readout, psArray *sources, pmPSF *psf );148 bool psphotMagnitudesReadout(pmConfig *config, psMetadata *recipe, const pmFPAview *view, pmReadout *readout, psArray *sources, pmPSF *psf, int index); 145 149 bool psphotMagnitudes_Threaded (psThreadJob *job); 146 150 … … 168 172 // in psphotChoosePSF.c: 169 173 bool psphotPSFstats (pmReadout *readout, pmPSF *psf); 174 bool psphotPSFstatsSources (pmReadout *readout, psArray *sources, pmPSF *psf); 170 175 bool psphotMomentsStats (pmReadout *readout, psArray *sources); 171 176 … … 232 237 int psphotSaveImage (psMetadata *header, psImage *image, char *filename); 233 238 bool psphotDumpConfig (pmConfig *config); 234 pmReadout *psphotSelectBackground (pmConfig *config, const pmFPAview *view );235 pmReadout *psphotSelectBackgroundStdev (pmConfig *config, const pmFPAview *view );239 pmReadout *psphotSelectBackground (pmConfig *config, const pmFPAview *view, int index); 240 pmReadout *psphotSelectBackgroundStdev (pmConfig *config, const pmFPAview *view, int index); 236 241 237 242 // PSF / DBL / EXT evaluation functions … … 571 576 bool psphotSourceMemoryReadout(pmConfig *config, const pmFPAview *view, const char *filerule, int index); 572 577 578 bool psphotChipParams(pmConfig *config, const pmFPAview *view, const char *filerule); 579 bool psphotChipParams_Threaded(psThreadJob *job); 580 573 581 const char * psphotGetFilerule(const char *baseRule); 574 582 extern bool psphotINpsphotStack; 575 583 584 576 585 #endif -
branches/eam_branches/ipp-pv3-20140717-merge/psphot/src/psphotChooseAnalysisOptions.c
r36453 r37825 606 606 psLogMsg ("psphot.options", PS_LOG_WARN, "choose analysis options for %ld objects: %f sec\n", objects->n, psTimerMark ("psphot.options")); 607 607 608 psFree(exptime); 609 psFree(zeropt); 610 psFree(chips); 611 psFree(inputFilters); 612 psFree(petroFluxLim); 613 psFree(extFitFluxLim); 608 614 psFree(toGal); 609 615 -
branches/eam_branches/ipp-pv3-20140717-merge/psphot/src/psphotChoosePSF.c
r36863 r37825 1 1 # include "psphotInternal.h" 2 bool psphotPSFstatsSources (pmReadout *readout, psArray *sources, pmPSF *psf); 2 3 3 4 // generate a PSF model for inputs without PSF models already loaded … … 388 389 psFree (models); 389 390 390 if (!psphotPSFstats (readout, psf)) { 391 // if (!psphotPSFstats (readout, psf)) { 392 393 if (!psphotPSFstatsSources (readout, sources, psf)) { 391 394 psError(PSPHOT_ERR_PSF, false, "cannot measure PSF shape terms"); 392 395 psFree(options); … … 466 469 467 470 if (modelPSF->params->n > 7) { 468 psVectorAppend (psfExtra1, modelPSF->params->data.F32[7]);471 psVectorAppend (psfExtra1, modelPSF->params->data.F32[7]); 469 472 } 470 473 if (modelPSF->params->n > 8) { 471 psVectorAppend (psfExtra2, modelPSF->params->data.F32[8]);474 psVectorAppend (psfExtra2, modelPSF->params->data.F32[8]); 472 475 } 473 476 psFree (modelPSF); … … 522 525 523 526 if (psfExtra1->n) { 524 if (!psVectorStats (stats, psfExtra1, NULL, NULL, 0)) { 525 psError(PS_ERR_UNKNOWN, false, "failure to measure stats for PSF EXTRA 1"); 527 if (!psVectorStats (stats, psfExtra1, NULL, NULL, 0)) { 528 psError(PS_ERR_UNKNOWN, false, "failure to measure stats for PSF EXTRA 1"); 529 goto escape; 530 } 531 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "PSF_EXT1", PS_META_REPLACE, "PSF extra param 1", stats->sampleMean); 532 psLogMsg ("psphot", PS_LOG_DETAIL, "PSF extra parameter 1: %f +/- %f", stats->sampleMean, stats->sampleStdev); 533 } 534 535 if (psfExtra2->n) { 536 if (!psVectorStats (stats, psfExtra2, NULL, NULL, 0)) { 537 psError(PS_ERR_UNKNOWN, false, "failure to measure stats for PSF EXTRA 2"); 538 goto escape; 539 } 540 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "PSF_EXT2", PS_META_REPLACE, "PSF extra param 2", stats->sampleMean); 541 psLogMsg ("psphot", PS_LOG_DETAIL, "PSF extra parameter 2: %f +/- %f", stats->sampleMean, stats->sampleStdev); 542 } 543 544 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "ANGLE", PS_META_REPLACE, "PSF angle", axes.theta); 545 psMetadataAddS32 (readout->analysis, PS_LIST_TAIL, "NPSFSTAR", PS_META_REPLACE, "Number of stars used to make PSF", psf->nPSFstars); 546 547 // psLogMsg ("psphot", PS_LOG_DETAIL, "PSF angle: %f, nstars: %d", axes.theta, psf->nPSFstars); 548 549 char *psfModelName = pmModelClassGetName(psf->type); 550 psMetadataAddStr(readout->analysis, PS_LIST_TAIL, "PSFMODEL", PS_META_REPLACE, "PSF Model Name", psfModelName); 551 psMetadataAddBool(readout->analysis, PS_LIST_TAIL, "PSF_OK", PS_META_REPLACE, "Valid PSF Model?", true); 552 553 int nParams = pmModelClassParameterCount(psf->type); 554 psMetadataAddS32(readout->analysis, PS_LIST_TAIL, "PSF_NPAR", PS_META_REPLACE, "Number of PSF parameters", nParams); 555 556 psFree (fwhmMajor); 557 psFree (fwhmMinor); 558 psFree (psfExtra1); 559 psFree (psfExtra2); 560 psFree (stats); 561 return true; 562 563 escape: 564 psFree (fwhmMajor); 565 psFree (fwhmMinor); 566 psFree (psfExtra1); 567 psFree (psfExtra2); 568 psFree (stats); 569 return false; 570 } 571 572 // measure average parameters of the PSF model 573 bool psphotPSFstatsSources (pmReadout *readout, psArray *sources, pmPSF *psf) { 574 575 psEllipseShape shape; 576 psEllipseAxes axes; 577 578 PS_ASSERT_PTR_NON_NULL(readout, false); 579 PS_ASSERT_PTR_NON_NULL(psf, false); 580 581 psImage *image = readout->image; 582 PS_ASSERT_PTR_NON_NULL(image, false); 583 584 // XXX a minor hack: measure the values for a grid of points across the image, determine mean, UQ, LQ, etc: 585 psVector *fwhmMajor = psVectorAllocEmpty (100, PS_DATA_F32); 586 psVector *fwhmMinor = psVectorAllocEmpty (100, PS_DATA_F32); 587 psVector *psfExtra1 = psVectorAllocEmpty (100, PS_DATA_F32); 588 psVector *psfExtra2 = psVectorAllocEmpty (100, PS_DATA_F32); 589 590 for (int i = 0; i < sources->n; i++) { 591 592 pmSource *source = sources->data[i]; 593 594 if (!(source->mode & PM_SOURCE_MODE_PSFSTAR)) continue; 595 596 float xc = source->peak->xf; 597 float yc = source->peak->yf; 598 599 // create modelPSF from this model 600 pmModel *modelPSF = pmModelFromPSFforXY (psf, xc, yc, 1.0); 601 if (!modelPSF) { 602 fprintf (stderr, "?"); 603 continue; 604 } 605 606 // get the model full-width at half-max 607 float FWHM_MAJOR = 2*modelPSF->class->modelRadius (modelPSF->params, 0.5); 608 609 // XXX make sure this is consistent with the re-definition of PM_PAR_SXX 610 shape.sx = modelPSF->params->data.F32[PM_PAR_SXX]; 611 shape.sy = modelPSF->params->data.F32[PM_PAR_SYY]; 612 shape.sxy = modelPSF->params->data.F32[PM_PAR_SXY]; 613 axes = psEllipseShapeToAxes (shape, 20.0); 614 615 float FWHM_MINOR = FWHM_MAJOR * (axes.minor / axes.major); 616 if (!isfinite(FWHM_MAJOR) || !isfinite(FWHM_MINOR)) { 617 fprintf (stderr, "!"); 618 psFree (modelPSF); 619 continue; 620 } 621 psVectorAppend (fwhmMajor, FWHM_MAJOR); 622 psVectorAppend (fwhmMinor, FWHM_MINOR); 623 624 if (modelPSF->params->n > 7) { 625 psVectorAppend (psfExtra1, modelPSF->params->data.F32[7]); 626 } 627 if (modelPSF->params->n > 8) { 628 psVectorAppend (psfExtra2, modelPSF->params->data.F32[8]); 629 } 630 psFree (modelPSF); 631 632 // float fwhmtest = pmPSFtoFWHM(psf, xc, yc); 633 // fprintf (stderr, "fwhm: %f, %f : %f\n", FWHM_MAJOR, FWHM_MINOR, fwhmtest); 634 } 635 636 psStats *stats = psStatsAlloc (PS_STAT_SAMPLE_MEAN | PS_STAT_SAMPLE_STDEV | PS_STAT_SAMPLE_QUARTILE); 637 if (!psVectorStats (stats, fwhmMajor, NULL, NULL, 0)) { 638 psError(PS_ERR_UNKNOWN, false, "failure to measure stats for FWHM MAJOR"); 526 639 goto escape; 527 } 528 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "PSF_EXT1", PS_META_REPLACE, "PSF extra param 1", stats->sampleMean); 529 psLogMsg ("psphot", PS_LOG_DETAIL, "PSF extra parameter 1: %f +/- %f", stats->sampleMean, stats->sampleStdev); 640 } 641 642 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "FWHM_MAJ", PS_META_REPLACE, "PSF FWHM Major axis (mean)", stats->sampleMean); 643 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "FW_MJ_SG", PS_META_REPLACE, "PSF FWHM Major axis (sigma)", stats->sampleStdev); 644 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "FW_MJ_LQ", PS_META_REPLACE, "PSF FWHM Major axis (lower quartile)", stats->sampleLQ); 645 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "FW_MJ_UQ", PS_META_REPLACE, "PSF FWHM Major axis (upper quartile)", stats->sampleUQ); 646 647 float fwhmMaj = stats->sampleMean; // FWHM on major axis 648 649 if (!psVectorStats (stats, fwhmMinor, NULL, NULL, 0)) { 650 psError(PS_ERR_UNKNOWN, false, "failure to measure stats for FWHM MINOR"); 651 goto escape; 652 } 653 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "FWHM_MIN", PS_META_REPLACE, "PSF FWHM Minor axis (mean)", stats->sampleMean); 654 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "FW_MN_SG", PS_META_REPLACE, "PSF FWHM Minor axis (sigma)", stats->sampleStdev); 655 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "FW_MN_LQ", PS_META_REPLACE, "PSF FWHM Minor axis (lower quartile)", stats->sampleLQ); 656 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "FW_MN_UQ", PS_META_REPLACE, "PSF FWHM Minor axis (upper quartile)", stats->sampleUQ); 657 658 float fwhmMin = stats->sampleMean; // FWHM on minor axis 659 660 if (readout->parent) { 661 662 // we now have 2 possible measurements of the seeing : the PSF model based version and 663 // the Moments based value we need to define a definitive "CHIP.SEEING" value. This 664 // value is used by the PSF-matching programs (ppSub and ppStack). The moments-based 665 // value is probably more representative of the value needed by those tools (it is also 666 // more stable?) 667 bool status = false; 668 float fwhmMajorMoments = psMetadataLookupF32(&status, readout->analysis, "IQ_FW1"); 669 float fwhmMinorMoments = psMetadataLookupF32(&status, readout->analysis, "IQ_FW1"); 670 671 pmChip *chip = readout->parent->parent; // Parent chip 672 psAssert(chip, "Cell should be attached to a chip."); 673 psMetadataItem *item = psMetadataLookup(chip->concepts, "CHIP.SEEING"); // Item with chip 674 item->data.F32 = 0.5 * (fwhmMajorMoments + fwhmMinorMoments); 675 676 psLogMsg ("psphot", PS_LOG_DETAIL, "fwhm (psf): %f,%f (moments): %f,%f", fwhmMaj, fwhmMin, fwhmMajorMoments, fwhmMinorMoments); 677 } 678 679 if (psfExtra1->n) { 680 if (!psVectorStats (stats, psfExtra1, NULL, NULL, 0)) { 681 psError(PS_ERR_UNKNOWN, false, "failure to measure stats for PSF EXTRA 1"); 682 goto escape; 683 } 684 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "PSF_EXT1", PS_META_REPLACE, "PSF extra param 1", stats->sampleMean); 685 psLogMsg ("psphot", PS_LOG_DETAIL, "PSF extra parameter 1: %f +/- %f", stats->sampleMean, stats->sampleStdev); 530 686 } 531 687 532 688 if (psfExtra2->n) { 533 if (!psVectorStats (stats, psfExtra2, NULL, NULL, 0)) {534 psError(PS_ERR_UNKNOWN, false, "failure to measure stats for PSF EXTRA 2");535 goto escape;536 }537 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "PSF_EXT2", PS_META_REPLACE, "PSF extra param 2", stats->sampleMean);538 psLogMsg ("psphot", PS_LOG_DETAIL, "PSF extra parameter 2: %f +/- %f", stats->sampleMean, stats->sampleStdev);689 if (!psVectorStats (stats, psfExtra2, NULL, NULL, 0)) { 690 psError(PS_ERR_UNKNOWN, false, "failure to measure stats for PSF EXTRA 2"); 691 goto escape; 692 } 693 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "PSF_EXT2", PS_META_REPLACE, "PSF extra param 2", stats->sampleMean); 694 psLogMsg ("psphot", PS_LOG_DETAIL, "PSF extra parameter 2: %f +/- %f", stats->sampleMean, stats->sampleStdev); 539 695 } 540 696 -
branches/eam_branches/ipp-pv3-20140717-merge/psphot/src/psphotCleanup.c
r36555 r37825 25 25 // don't display memory leaks unless trace is on. 26 26 // fprintf (stderr, "found %d leaks at %s\n", psMemCheckLeaks (0, NULL, NULL, false), "psphot"); 27 fprintf (stderr, "found %d leaks at %s\n", psMemCheckLeaks (0, NULL, stdout, false), "psphot");27 fprintf (stderr, "found %d leaks at %s\n", psMemCheckLeaks2 (0, NULL, stdout, false, 500), "psphot"); 28 28 #endif 29 29 return; -
branches/eam_branches/ipp-pv3-20140717-merge/psphot/src/psphotEfficiency.c
r36863 r37825 502 502 503 503 // measure the magnitudes and fluxes for the sources 504 if (!psphotMagnitudesReadout(config, recipe, view, readout, fakeSourcesAll, psf )) {504 if (!psphotMagnitudesReadout(config, recipe, view, readout, fakeSourcesAll, psf, index)) { 505 505 psError(PS_ERR_UNKNOWN, false, "Unable to measure magnitudes of fake sources."); 506 506 psFree(fakeSources); -
branches/eam_branches/ipp-pv3-20140717-merge/psphot/src/psphotExtendedSourceAnalysis.c
r36375 r37825 38 38 39 39 /*** for the moment, this test code : it is not thread safe ***/ 40 int Nall = 0;41 int Nskip1 = 0;42 int Nskip2 = 0;43 int Nskip3 = 0;44 int Nskip4 = 0;45 int Nskip5 = 0;46 int Nskip6 = 0;40 static int Nall = 0; 41 static int Nskip1 = 0; 42 static int Nskip2 = 0; 43 static int Nskip3 = 0; 44 static int Nskip4 = 0; 45 static int Nskip5 = 0; 46 static int Nskip6 = 0; 47 47 48 48 # define SKIP(VALUE) { VALUE++; continue; } -
branches/eam_branches/ipp-pv3-20140717-merge/psphot/src/psphotExtendedSourceFits.c
r36375 r37825 629 629 pmSourceCacheModel (source, maskVal); 630 630 631 # if ( PS_TRACE_ON)631 # if (0 && PS_TRACE_ON) 632 632 pmModel *model = source->modelFits->data[0]; 633 633 int flags = 0xffffffff; -
branches/eam_branches/ipp-pv3-20140717-merge/psphot/src/psphotFitSourcesLinear.c
r34418 r37825 263 263 } 264 264 } 265 if (modelSum == 0 || maskedSum == 0) { 266 // no pixels at all drop the modelPSF (probably only an issue for external sources 267 // which are created from a fake peak (full force)) 268 psFree(source->modelPSF); 269 continue; 270 } 265 271 if (modelSum < 0.5) continue; // skip sources with no model constraint (somewhat arbitrary limit) 266 272 if (modelSum < 0.8) { -
branches/eam_branches/ipp-pv3-20140717-merge/psphot/src/psphotFullForceReadout.c
r36663 r37825 106 106 psphotKronFlux (config, view, filerule); 107 107 108 psphotChipParams (config, view, filerule); 109 108 110 // measure petro fluxes 109 111 psphotPetroFlux (config, view, filerule); … … 114 116 // measure galaxy shapes 115 117 psphotGalaxyShape (config, view, filerule); 118 119 // measure aperture photometry corrections 120 if (!psphotApResid (config, view, filerule)) { 121 psLogMsg ("psphot", 3, "failed on psphotApResid"); 122 return psphotReadoutCleanup (config, view, filerule); 123 } 116 124 117 125 // calculate source magnitudes (psf mag and ap mag) -
branches/eam_branches/ipp-pv3-20140717-merge/psphot/src/psphotMagnitudes.c
r34404 r37825 38 38 psAssert (psf, "missing psf?"); 39 39 40 if (!psphotMagnitudesReadout (config, recipe, view, readout, sources, psf )) {40 if (!psphotMagnitudesReadout (config, recipe, view, readout, sources, psf, i)) { 41 41 psError (PSPHOT_ERR_CONFIG, false, "failed to measure magnitudes for %s entry %d", filerule, i); 42 42 return false; … … 46 46 } 47 47 48 bool psphotMagnitudesReadout(pmConfig *config, psMetadata *recipe, const pmFPAview *view, pmReadout *readout, psArray *sources, pmPSF *psf ) {48 bool psphotMagnitudesReadout(pmConfig *config, psMetadata *recipe, const pmFPAview *view, pmReadout *readout, psArray *sources, pmPSF *psf, int index) { 49 49 50 50 bool status = false; … … 65 65 66 66 // if backModel or backStdev are missing, the values of sky and/or skyErr will be set to NAN 67 pmReadout *backModel = psphotSelectBackground (config, view );68 pmReadout *backStdev = psphotSelectBackgroundStdev (config, view );67 pmReadout *backModel = psphotSelectBackground (config, view, index); 68 pmReadout *backStdev = psphotSelectBackgroundStdev (config, view, index); 69 69 70 70 // bit-masks to test for good/bad pixels -
branches/eam_branches/ipp-pv3-20140717-merge/psphot/src/psphotOutput.c
r35769 r37825 29 29 } 30 30 31 pmReadout *psphotSelectBackground (pmConfig *config, const pmFPAview *view) { 32 33 bool status; 34 35 36 pmFPAfile *file = psMetadataLookupPtr (&status, config->files, psphotGetFilerule("PSPHOT.BACKMDL")); 31 pmReadout *psphotSelectBackground (pmConfig *config, const pmFPAview *view, int index) { 32 33 pmFPAfile *file = pmFPAfileSelectSingle (config->files, psphotGetFilerule("PSPHOT.BACKMDL"), index); 37 34 if (!file) return NULL; 38 35 … … 41 38 } 42 39 43 pmReadout *psphotSelectBackgroundStdev (pmConfig *config, const pmFPAview *view) { 44 45 bool status; 46 47 pmFPAfile *file = psMetadataLookupPtr (&status, config->files, psphotGetFilerule("PSPHOT.BACKMDL.STDEV")); 40 pmReadout *psphotSelectBackgroundStdev (pmConfig *config, const pmFPAview *view, int index) { 41 42 pmFPAfile *file = pmFPAfileSelectSingle (config->files, psphotGetFilerule("PSPHOT.BACKMDL.STDEV"), index); 48 43 if (!file) return NULL; 49 44 -
branches/eam_branches/ipp-pv3-20140717-merge/psphot/src/psphotPetrosianAnalysis.c
r31154 r37825 12 12 // XXX temporary user-supplied systematic sky noise measurement (derive from background model) 13 13 float skynoise = psMetadataLookupF32 (&status, recipe, "SKY.NOISE"); 14 15 # if (0)16 // if backModel or backStdev are missing, the values of sky and/or skyErr will be set to NAN17 // XXX use this to set skynoise18 pmReadout *backModel = psphotSelectBackground (config, view);19 pmReadout *backStdev = psphotSelectBackgroundStdev (config, view);20 # endif21 14 22 15 // S/N limit to perform full non-linear fits -
branches/eam_branches/ipp-pv3-20140717-merge/psphot/src/psphotReadout.c
r36623 r37825 325 325 psphotExtendedSourceAnalysis (config, view, filerule); // pass 1 (detections->allSources) 326 326 psphotExtendedSourceFits (config, view, filerule); // pass 1 (detections->allSources) 327 // measure some parameters for galaxy science 328 psphotGalaxyParams (config, view, filerule); 327 329 psphotRadialApertures(config, view, filerule, 0); 328 330 -
branches/eam_branches/ipp-pv3-20140717-merge/psphot/src/psphotReadoutCleanup.c
r35771 r37825 57 57 // use the psf-model to measure FWHM stats 58 58 if (psf) { 59 if (!psphotPSFstats (readout, psf)) {59 if (!psphotPSFstatsSources (readout, sources, psf)) { 60 60 psError(PSPHOT_ERR_PROG, false, "Failed to measure PSF shape parameters"); 61 61 return false; -
branches/eam_branches/ipp-pv3-20140717-merge/psphot/src/psphotSetNFrames.c
r33691 r37825 45 45 46 46 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); 47 psAssert (detections, "missing detections?"); 48 psAssert (detections->allSources, "missing sources?"); 47 if (!detections) { 48 psLogMsg ("psphot", PS_LOG_INFO, "No detections image input %d", index); 49 return true; 50 } 49 51 50 52 psArray *sources = detections->allSources; 53 if (!sources) { 54 psLogMsg ("psphot", PS_LOG_INFO, "No sources for input %d", index); 55 return true; 56 } 51 57 52 58 int col0 = expnum->col0; -
branches/eam_branches/ipp-pv3-20140717-merge/psphot/src/psphotSetThreads.c
r36375 r37825 87 87 psFree(task); 88 88 89 task = psThreadTaskAlloc("PSPHOT_CHIP_PARAMS", 2); 90 task->function = &psphotChipParams_Threaded; 91 psThreadTaskAdd(task); 92 psFree(task); 93 94 task = psThreadTaskAlloc("PSPHOT_GALAXY_PARAMS", 11); 95 task->function = &psphotGalaxyParams_Threaded; 96 psThreadTaskAdd(task); 97 psFree(task); 98 89 99 return true; 90 100 } -
branches/eam_branches/ipp-pv3-20140717-merge/psphot/src/psphotSourceStats.c
r36375 r37825 185 185 psThreadJob *job = psThreadJobAlloc ("PSPHOT_SOURCE_STATS"); 186 186 187 psArrayAdd(job->args, 1, cells->data[j]); // sources188 189 PS_ARRAY_ADD_SCALAR(job->args, INNER, PS_TYPE_F32); 190 PS_ARRAY_ADD_SCALAR(job->args, MIN_SN, PS_TYPE_F32); 191 PS_ARRAY_ADD_SCALAR(job->args, RADIUS, PS_TYPE_F32); 192 PS_ARRAY_ADD_SCALAR(job->args, SIGMA, PS_TYPE_F32); 193 PS_ARRAY_ADD_SCALAR(job->args, MIN_KRON_RADIUS, PS_TYPE_F32); 194 195 PS_ARRAY_ADD_SCALAR(job->args, maskVal, PS_TYPE_IMAGE_MASK); 196 PS_ARRAY_ADD_SCALAR(job->args, markVal, PS_TYPE_IMAGE_MASK); 197 198 PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // this is used as a return value for Nmoments199 PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // this is used as a return value for Nfail200 PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // this is used as a return value for Nfaint187 psArrayAdd(job->args, 1, cells->data[j]); // 0 : sources 188 189 PS_ARRAY_ADD_SCALAR(job->args, INNER, PS_TYPE_F32); // 1 190 PS_ARRAY_ADD_SCALAR(job->args, MIN_SN, PS_TYPE_F32); // 2 191 PS_ARRAY_ADD_SCALAR(job->args, RADIUS, PS_TYPE_F32); // 3 192 PS_ARRAY_ADD_SCALAR(job->args, SIGMA, PS_TYPE_F32); // 4 193 PS_ARRAY_ADD_SCALAR(job->args, MIN_KRON_RADIUS, PS_TYPE_F32); // 5 194 195 PS_ARRAY_ADD_SCALAR(job->args, maskVal, PS_TYPE_IMAGE_MASK); // 6 196 PS_ARRAY_ADD_SCALAR(job->args, markVal, PS_TYPE_IMAGE_MASK); // 7 197 198 PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // 8 : this is used as a return value for Nmoments 199 PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // 9 : this is used as a return value for Nfail 200 PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // 10 : this is used as a return value for Nfaint 201 201 202 202 if (!psThreadJobAddPending(job)) { … … 316 316 317 317 // XXX: this must match the above 318 psAbort ("this code is broken: must match psphotSourceStatsReadout above"); 318 319 psArrayAdd(job->args, 1, cells->data[j]); // sources 319 320 psArrayAdd(job->args, 1, recipe); … … 472 473 473 474 // change the value of a scalar on the array (wrap this and put it in psArray.h) 474 scalar = job->args->data[ 7];475 scalar = job->args->data[8]; 475 476 scalar->data.S32 = Nmoments; 476 477 477 scalar = job->args->data[ 8];478 scalar = job->args->data[9]; 478 479 scalar->data.S32 = Nfail; 479 480 480 scalar = job->args->data[ 9];481 scalar = job->args->data[10]; 481 482 scalar->data.S32 = Nfaint; 482 483 -
branches/eam_branches/ipp-pv3-20140717-merge/psphot/src/psphotStackParseCamera.c
r34528 r37825 262 262 } 263 263 264 #ifdef MAKE_CHISQ_IMAGE 264 265 // generate an pmFPAimage for the chisqImage 265 266 { … … 293 294 chisqVariance->save = saveChisq; 294 295 } 296 #else 297 (void) saveChisq; 298 #endif // MAKE_CHISQ_IMAGE 295 299 296 300 psTrace("psphot", 1, "Done with psphotStackParseCamera...\n"); -
branches/eam_branches/ipp-pv3-20140717-merge/psphot/src/psphotStackReadout.c
r36630 r37825 341 341 // measure non-linear extended source models (exponential, deVaucouleur, Sersic) (sources sorted by S/N) 342 342 psphotExtendedSourceFits (config, view, STACK_RAW); // pass 1 (detections->allSources) 343 344 // measure some parameters for galxy science 345 psphotGalaxyParams (config, view, STACK_RAW); // pass 1 (detections->allSources) 343 346 344 347 // create source children for the OUT filerule (for radial aperture photometry and output) … … 354 357 return psphotReadoutCleanup (config, view, STACK_RAW); 355 358 } 359 // These arrays are no longer needed. The inputs' sources arrays have references to the data 360 psFree (objects); 361 psFree (objectsOut); 356 362 357 363 bool radial_apertures = psMetadataLookupBool(NULL, recipe, "RADIAL_APERTURES"); … … 410 416 // measure aperture photometry corrections 411 417 if (!psphotApResid (config, view, STACK_RAW)) { 412 psFree (objects);413 psFree (objectsOut);414 418 psLogMsg ("psphot", 3, "failed on psphotApResid"); 415 419 return psphotReadoutCleanup (config, view, STACK_RAW); … … 432 436 433 437 logMemStats("final"); 434 #if ( 1)438 #if (0) 435 439 psphotSourceMemory(config, view, STACK_RAW); 436 440 psphotSourceMemory(config, view, STACK_OUT); … … 448 452 psphotStackRemoveChisqFromInputs(config, STACK_RAW); 449 453 #endif 450 451 psFree (objects);452 psFree (objectsOut);453 454 454 455 // create the exported-metadata and free local data
Note:
See TracChangeset
for help on using the changeset viewer.
