Changeset 42380 for trunk/psphot/src/psphotChoosePSF.c
- Timestamp:
- Feb 8, 2023, 11:54:58 AM (3 years ago)
- Location:
- trunk/psphot
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/psphotChoosePSF.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20220316/psphot (added) merged: 42187,42224,42364
- Property svn:mergeinfo changed
-
trunk/psphot/src/psphotChoosePSF.c
r42087 r42380 594 594 psVector *psfExtra2 = psVectorAllocEmpty (100, PS_DATA_F32); 595 595 596 // count how many PSF stars are defined 597 int nPSFstars = 0; // count the number of PSF stars 596 598 for (int i = 0; i < sources->n; i++) { 597 598 599 pmSource *source = sources->data[i]; 599 600 600 if (!(source->mode & PM_SOURCE_MODE_PSFSTAR)) continue; 601 } 602 603 for (int i = 0; i < sources->n; i++) { 604 605 pmSource *source = sources->data[i]; 606 607 // If no sources are PSFSTARs, then let's just use all with S/N > 0.1. 608 // (This can happen if all are supplied) 609 if (nPSFstars) { 610 if (!(source->mode & PM_SOURCE_MODE_PSFSTAR)) continue; 611 } else { 612 if (source->psfMagErr > 0.1) continue; 613 } 601 614 602 615 float xc = source->peak->xf; … … 638 651 // float fwhmtest = pmPSFtoFWHM(psf, xc, yc); 639 652 // fprintf (stderr, "fwhm: %f, %f : %f\n", FWHM_MAJOR, FWHM_MINOR, fwhmtest); 653 } 654 655 // XXX should we catch this case and exit immediately? (need to raise an error?) 656 if (0 && !fwhmMajor->n) { 657 psLogMsg ("psphot", PS_LOG_DETAIL, "no stars on the chip to measure PSF FWHM"); 658 goto escape; 640 659 } 641 660 … … 721 740 722 741 escape: 742 // failed to measure the PSF stats 743 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "FWHM_MAJ", PS_META_REPLACE, "PSF FWHM Major axis (mean)", NAN); 744 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "FW_MJ_SG", PS_META_REPLACE, "PSF FWHM Major axis (sigma)", NAN); 745 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "FW_MJ_LQ", PS_META_REPLACE, "PSF FWHM Major axis (lower quartile)", NAN); 746 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "FW_MJ_UQ", PS_META_REPLACE, "PSF FWHM Major axis (upper quartile)", NAN); 747 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "FWHM_MIN", PS_META_REPLACE, "PSF FWHM Minor axis (mean)", NAN); 748 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "FW_MN_SG", PS_META_REPLACE, "PSF FWHM Minor axis (sigma)", NAN); 749 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "FW_MN_LQ", PS_META_REPLACE, "PSF FWHM Minor axis (lower quartile)", NAN); 750 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "FW_MN_UQ", PS_META_REPLACE, "PSF FWHM Minor axis (upper quartile)", NAN); 751 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "ANGLE", PS_META_REPLACE, "PSF angle", NAN); 752 psMetadataAddS32 (readout->analysis, PS_LIST_TAIL, "NPSFSTAR", PS_META_REPLACE, "Number of stars used to make PSF", 0); 753 psMetadataAddBool(readout->analysis, PS_LIST_TAIL, "PSF_OK", PS_META_REPLACE, "Valid PSF Model?", false); 754 723 755 psFree (fwhmMajor); 724 756 psFree (fwhmMinor);
Note:
See TracChangeset
for help on using the changeset viewer.
