Changeset 5068 for trunk/psphot/src/psphotOutput.c
- Timestamp:
- Sep 19, 2005, 12:26:40 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotOutput.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotOutput.c
r5058 r5068 31 31 32 32 if (!strcasecmp (outputMode, "SX")) { 33 pmSourcesWriteSX (imdata, outputFile, sources, psf, sky);33 pmSourcesWriteSX (imdata, config, outputFile, sources, psf, sky); 34 34 return; 35 35 } … … 159 159 } 160 160 161 // elixir /sextractor-style output list with fixed line width162 bool pmSourcesWriteSX (eamReadout *imdata, char *filename, psArray *sources, pmPSF *psf, psStats *skyStats) {161 // elixir-mode / sextractor-style output list with fixed line width 162 bool pmSourcesWriteSX (eamReadout *imdata, psMetadata *config, char *filename, psArray *sources, pmPSF *psf, psStats *skyStats) { 163 163 164 164 int i, status, flags; … … 166 166 psF32 *PAR, *dPAR; 167 167 float sky, dmag, apMag, fitMag; 168 169 psLine *line = psLineAlloc (110); // 104 is dophot-defined line length 168 float x, y, rflux; 169 bool result; 170 171 psLine *line = psLineAlloc (110); // 110 is sextractor line length 170 172 171 173 FILE *f = fopen (filename, "w"); … … 174 176 return false; 175 177 } 178 179 // aperture radius for ap magnitude 180 float RADIUS = psMetadataLookupF32 (&result, config, "PSF_FIT_RADIUS"); 176 181 177 182 // write sources with models first … … 214 219 dPAR = model->dparams->data.F32; 215 220 221 x = source->peak->x; 222 y = source->peak->y; 223 224 // we have already (psphotApplyPSF) defined pixels at least OUTER_RADIUS from source 225 // we need to mask pixels to measure the aperture magnitude 226 // set aperture mask circle of PSF_FIT_RADIUS 227 psImageKeepCircle (source->mask, x, y, RADIUS, "OR", PSPHOT_MASK_MARKED); 228 216 229 // save local sky for later 217 230 sky = model->params->data.F32[0]; … … 224 237 225 238 // measure object photometry 226 status = pmSourcePhotometry (&fitMag, &apMag, model, source->pixels, source->mask); 239 status = pmSourcePhotometry (&fitMag, &apMag, model, source->pixels, source->mask); 240 241 // correct both apMag and fitMag to same system, consistent with infinite flux star in aperture RADIUS 242 rflux = pow (10.0, 0.4*fitMag); 243 apMag -= rflux * psf->skyBias * (M_PI * PS_SQR(RADIUS)); 227 244 fitMag += psf->ApResid; 228 245 … … 232 249 pmSourceSubModel (source->pixels, source->mask, model, false); 233 250 model->params->data.F32[0] = sky; 251 252 // unmask aperture 253 psImageKeepCircle (source->mask, x, y, RADIUS, "AND", ~PSPHOT_MASK_MARKED); 234 254 235 255 if (status == FALSE) continue;
Note:
See TracChangeset
for help on using the changeset viewer.
