Changeset 4574 for trunk/psphot/src/mark_psf_source.c
- Timestamp:
- Jul 16, 2005, 6:02:29 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/mark_psf_source.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/mark_psf_source.c
r4375 r4574 15 15 // PS_SOURCE_BRIGHTSTAR 16 16 # define MIN_DS 0.01 17 bool mark_psf_source (psSource *source, float shapeNsigma )17 bool mark_psf_source (psSource *source, float shapeNsigma, float SATURATE) 18 18 { 19 19 float dSX, dSY, SX, SY, SN; … … 22 22 if (source->modelPSF == NULL) return (false); 23 23 24 // SATSTAR objects are fitted with PSF regardless 25 if (source->type == PS_SOURCE_SATSTAR) return (true); 24 // if object has fitted peak above saturation, label as SATSTAR 25 // remember: fit does not use saturated pixels (masked) 26 if (source->modelPSF->params->data.F32[1] >= SATURATE) { 27 if (source->type == PS_SOURCE_PSFSTAR) { 28 psLogMsg ("psphot", 3, "PSFSTAR marked saturated\n"); 29 } 30 source->type = PS_SOURCE_SATSTAR; 31 return (true); 32 } 33 if (source->type == PS_SOURCE_SATSTAR) { 34 psLogMsg ("psphot", 4, "SATSTAR marked bright (fitted peak below saturation)\n"); 35 source->type = PS_SOURCE_BRIGHTSTAR; 36 } 26 37 27 38 SN = source->modelPSF->params->data.F32[1]/source->modelPSF->dparams->data.F32[1]; … … 35 46 // sigma = 1 / SX 36 47 // dsx = 1 / (SX * SN) 37 // dsx_o = hypot (1/ SX*SN +MIN_DSX)48 // dsx_o = hypot (1/(SX*SN), MIN_DSX) 38 49 39 50 // assign PS_SOURCE_BRIGHTSTAR to bright objects within PSF region of dparams[] 40 51 if ((fabs(nSx) < shapeNsigma) && (fabs(nSy) < shapeNsigma)) { 41 if (source->type == PS_SOURCE_PSFSTAR) return (true);42 source->type = PS_SOURCE_BRIGHTSTAR;43 return (true);52 if (source->type == PS_SOURCE_PSFSTAR) return (true); 53 source->type = PS_SOURCE_BRIGHTSTAR; 54 return (true); 44 55 } 45 56 46 57 if (source->type == PS_SOURCE_PSFSTAR) { 47 psLogMsg ("psphot", 3, "PSFSTAR demoted based on dSx, dSy\n");58 psLogMsg ("psphot", 3, "PSFSTAR demoted based on dSx, dSy\n"); 48 59 } 49 60 50 61 if ((nSx >= shapeNsigma) || (nSy >= shapeNsigma)) { 51 source->type = PS_SOURCE_GALAXY;52 return (false);62 source->type = PS_SOURCE_GALAXY; 63 return (false); 53 64 } 54 65 // replace DEFECT with COSMIC? 55 66 if ((nSx <= -shapeNsigma) || (nSy <= -shapeNsigma)) { 56 source->type = PS_SOURCE_DEFECT;57 return (false);67 source->type = PS_SOURCE_DEFECT; 68 return (false); 58 69 } 59 70 psTrace (".psphot.mark_psf_source", 2, "unexpected result: unmarked object\n");
Note:
See TracChangeset
for help on using the changeset viewer.
