Changeset 18554 for trunk/psModules/src/objects/pmPSFtry.c
- Timestamp:
- Jul 15, 2008, 10:25:00 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmPSFtry.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmPSFtry.c
r18040 r18554 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1.5 6$ $Name: not supported by cvs2svn $8 * @date $Date: 2008-0 6-10 01:32:15$7 * @version $Revision: 1.57 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2008-07-15 20:25:00 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 98 98 99 99 // generate a pmPSFtry with a copy of the test PSF sources 100 pmPSFtry *pmPSFtryModel (const psArray *sources, const char *modelName, pmPSFOptions *options, psMaskType maskVal, psMaskType mark )100 pmPSFtry *pmPSFtryModel (const psArray *sources, const char *modelName, pmPSFOptions *options, psMaskType maskVal, psMaskType markVal) 101 101 { 102 102 bool status; … … 116 116 return NULL; 117 117 } 118 119 // maskVal is used to test for rejected pixels, and must include markVal 120 maskVal |= markVal; 118 121 119 122 // stage 1: fit an EXT model to all candidates PSF sources … … 129 132 } 130 133 131 // set object mask to define valid pixels -- XXX not unset?132 psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "OR", mark );134 // set object mask to define valid pixels 135 psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "OR", markVal); 133 136 134 137 // fit model as EXT, not PSF 135 138 status = pmSourceFitModel (source, source->modelEXT, PM_SOURCE_FIT_EXT, maskVal); 139 140 // clear object mask to define valid pixels 141 psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "AND", PS_NOT_U8(markVal)); 136 142 137 143 // exclude the poor fits … … 170 176 source->modelPSF->radiusFit = options->radius; 171 177 172 // set object mask to define valid pixels -- XXX not unset?173 psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "OR", mark );178 // set object mask to define valid pixels 179 psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "OR", markVal); 174 180 175 181 // fit the PSF model to the source … … 178 184 // skip poor fits 179 185 if (!status) { 186 psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "AND", PS_NOT_U8(markVal)); 180 187 psfTry->mask->data.U8[i] = PSFTRY_MASK_PSF_FAIL; 181 188 psTrace ("psModules.objects", 4, "dropping %d (%d,%d) : failed PSF fit\n", i, source->peak->x, source->peak->y); … … 183 190 } 184 191 185 // XXX : use a different aperture radius from the fit radius? 186 status = pmSourceMagnitudes (source, psfTry->psf, PM_SOURCE_PHOT_INTERP, maskVal, mark); 192 status = pmSourceMagnitudes (source, psfTry->psf, PM_SOURCE_PHOT_INTERP, maskVal); 187 193 if (!status || isnan(source->apMag)) { 194 psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "AND", PS_NOT_U8(markVal)); 188 195 psfTry->mask->data.U8[i] = PSFTRY_MASK_BAD_PHOT; 189 196 psTrace ("psModules.objects", 4, "dropping %d (%d,%d) : poor photometry\n", i, source->peak->x, source->peak->y); 190 197 continue; 191 198 } 199 200 // clear object mask to define valid pixels 201 psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "AND", PS_NOT_U8(markVal)); 192 202 193 203 psfTry->fitMag->data.F32[i] = source->psfMag;
Note:
See TracChangeset
for help on using the changeset viewer.
