Changeset 4630 for trunk/psphot/src/mark_psf_source.c
- Timestamp:
- Jul 27, 2005, 3:26:57 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/mark_psf_source.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/mark_psf_source.c
r4574 r4630 15 15 // PS_SOURCE_BRIGHTSTAR 16 16 # define MIN_DS 0.01 17 bool mark_psf_source (psSource *source, float shapeNsigma, float SATURATE)17 bool mark_psf_source (psSource *source, float shapeNsigma, float minSN, float maxChi, float SATURATE) 18 18 { 19 int keep; 19 20 float dSX, dSY, SX, SY, SN; 20 float nSx, nSy ;21 float nSx, nSy, Chi; 21 22 22 23 if (source->modelPSF == NULL) return (false); … … 26 27 if (source->modelPSF->params->data.F32[1] >= SATURATE) { 27 28 if (source->type == PS_SOURCE_PSFSTAR) { 28 psLogMsg ("psphot", 3, "PSFSTAR marked saturated\n");29 psLogMsg ("psphot", 3, "PSFSTAR marked SATSTAR\n"); 29 30 } 30 31 source->type = PS_SOURCE_SATSTAR; … … 32 33 } 33 34 if (source->type == PS_SOURCE_SATSTAR) { 34 psLogMsg ("psphot", 4, "SATSTAR marked bright(fitted peak below saturation)\n");35 source->type = PS_SOURCE_ BRIGHTSTAR;35 psLogMsg ("psphot", 4, "SATSTAR marked GOODSTAR (fitted peak below saturation)\n"); 36 source->type = PS_SOURCE_GOODSTAR; 36 37 } 37 38 … … 41 42 dSX = source->modelPSF->dparams->data.F32[4]; 42 43 dSY = source->modelPSF->dparams->data.F32[5]; 44 Chi = source->modelPSF->chisq / source->modelPSF->nDOF; 43 45 44 46 nSx = dSX / hypot (MIN_DS, 1 / (SX * SN)); … … 48 50 // dsx_o = hypot (1/(SX*SN), MIN_DSX) 49 51 50 // assign PS_SOURCE_BRIGHTSTAR to bright objects within PSF region of dparams[] 51 if ((fabs(nSx) < shapeNsigma) && (fabs(nSy) < shapeNsigma)) { 52 // assign PS_SOURCE_GOODSTAR to bright objects within PSF region of dparams[] 53 keep = TRUE; 54 keep &= (fabs(nSx) < shapeNsigma); 55 keep &= (fabs(nSy) < shapeNsigma); 56 keep &= (SN > minSN); 57 keep &= (Chi < maxChi); 58 if (keep) { 52 59 if (source->type == PS_SOURCE_PSFSTAR) return (true); 53 source->type = PS_SOURCE_ BRIGHTSTAR;60 source->type = PS_SOURCE_GOODSTAR; 54 61 return (true); 55 62 } 56 63 57 64 if (source->type == PS_SOURCE_PSFSTAR) { 58 psLogMsg ("psphot", 3, "PSFSTAR demoted based on dSx, dSy\n");65 psLogMsg ("psphot", 3, "PSFSTAR demoted based on fit quality\n"); 59 66 } 60 67 68 // object appears to be small, suspected defect 69 if ((nSx <= -shapeNsigma) || (nSy <= -shapeNsigma)) { 70 source->type = PS_SOURCE_DEFECT; 71 return (false); 72 } 73 74 // object appears to be large, suspected galaxy 61 75 if ((nSx >= shapeNsigma) || (nSy >= shapeNsigma)) { 62 76 source->type = PS_SOURCE_GALAXY; 63 77 return (false); 64 78 } 65 // replace DEFECT with COSMIC? 66 if ((nSx <= -shapeNsigma) || (nSy <= -shapeNsigma)) { 67 source->type = PS_SOURCE_DEFECT; 79 80 // object appears to be extremely faint: what is this? 81 if (SN < minSN) { 82 source->type = PS_SOURCE_FAINTSTAR; 68 83 return (false); 69 84 } 70 psTrace (".psphot.mark_psf_source", 2, "unexpected result: unmarked object\n"); 85 86 // these are pooly fitted, probable stars near other stars? 87 source->type = PS_SOURCE_POOR_FIT_PSF; 71 88 return (false); 72 89 }
Note:
See TracChangeset
for help on using the changeset viewer.
