Changeset 18857
- Timestamp:
- Aug 1, 2008, 12:11:51 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmPSFtry.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmPSFtry.c
r18581 r18857 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1.5 8$ $Name: not supported by cvs2svn $8 * @date $Date: 2008-0 7-16 23:06:10$7 * @version $Revision: 1.59 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2008-08-01 22:11:51 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 138 138 status = pmSourceFitModel (source, source->modelEXT, PM_SOURCE_FIT_EXT, maskVal); 139 139 140 // clear object mask to define valid pixels140 // clear object mask to define valid pixels 141 141 psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "AND", PS_NOT_U8(markVal)); 142 142 … … 152 152 psTrace ("psphot.psftry", 3, "keeping %d of %ld PSF candidates (EXT)\n", Next, sources->n); 153 153 154 if (Next == 0) { 155 psError(PS_ERR_UNKNOWN, true, "No sources with good extended fits from which to determine PSF."); 156 psFree(psfTry); 157 return NULL; 158 } 159 154 160 // stage 2: construct a psf (pmPSF) from this collection of model fits 155 161 if (!pmPSFFromPSFtry (psfTry)) { … … 169 175 psTrace ("psModules.objects", 4, "dropping %d (%d,%d) : source is masked\n", i, source->peak->x, source->peak->y); 170 176 continue; 171 }177 } 172 178 173 179 // set shape for this model based on PSF … … 188 194 // skip poor fits 189 195 if (!status) { 190 psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "AND", PS_NOT_U8(markVal));196 psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "AND", PS_NOT_U8(markVal)); 191 197 psfTry->mask->data.U8[i] = PSFTRY_MASK_PSF_FAIL; 192 198 psTrace ("psModules.objects", 4, "dropping %d (%d,%d) : failed PSF fit\n", i, source->peak->x, source->peak->y); … … 195 201 196 202 status = pmSourceMagnitudes (source, psfTry->psf, PM_SOURCE_PHOT_INTERP, maskVal); 197 if (!status || isnan(source->apMag)) {198 psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "AND", PS_NOT_U8(markVal));203 if (!status || isnan(source->apMag)) { 204 psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "AND", PS_NOT_U8(markVal)); 199 205 psfTry->mask->data.U8[i] = PSFTRY_MASK_BAD_PHOT; 200 206 psTrace ("psModules.objects", 4, "dropping %d (%d,%d) : poor photometry\n", i, source->peak->x, source->peak->y); … … 202 208 } 203 209 204 // clear object mask to define valid pixels210 // clear object mask to define valid pixels 205 211 psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "AND", PS_NOT_U8(markVal)); 206 212 … … 209 215 psfTry->metricErr->data.F32[i] = source->errMag; 210 216 211 psTrace ("psphot.psftry", 6, "keeping source %d (%d) of %ld\n", i, Npsf, psfTry->sources->n);217 psTrace ("psphot.psftry", 6, "keeping source %d (%d) of %ld\n", i, Npsf, psfTry->sources->n); 212 218 Npsf ++; 213 219 } … … 268 274 if (!pmPSFtryMetric (psfTry, options)) { 269 275 psError(PS_ERR_UNKNOWN, false, "Attempt to fit PSF with model %s failed.", modelName); 270 psFree (psfTry);276 psFree (psfTry); 271 277 return NULL; 272 278 }
Note:
See TracChangeset
for help on using the changeset viewer.
