Changeset 20081
- Timestamp:
- Oct 12, 2008, 4:03:52 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotApResid.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotApResid.c
r19950 r20081 47 47 48 48 // this is the smallest radius allowed: need to at least extend growth curve down to this... 49 float PSF_FIT_PAD = psMetadataLookupF32 (&status, recipe, "PSF_FIT_PADDING");50 49 bool IGNORE_GROWTH = psMetadataLookupBool (&status, recipe, "IGNORE_GROWTH"); 51 50 bool INTERPOLATE_AP = psMetadataLookupBool (&status, recipe, "INTERPOLATE_AP"); … … 70 69 // set limits on the aperture magnitudes 71 70 pmSourceMagnitudesInit (recipe); 72 73 // measure the aperture loss as a function of radius for PSF74 float REF_RADIUS = psMetadataLookupF32 (&status, recipe, "PSF_REF_RADIUS");75 psf->growth = pmGrowthCurveAlloc (PSF_FIT_PAD, 100.0, REF_RADIUS);76 77 if (!pmGrowthCurveGenerate (readout, psf, IGNORE_GROWTH, maskVal, markVal)) {78 psError(PSPHOT_ERR_APERTURE, false, "Fitting aperture corrections");79 psFree(psf->growth); psf->growth = NULL;80 return false;81 }82 71 83 72 psVector *mask = psVectorAllocEmpty (300, PS_TYPE_U8); … … 210 199 // save results for later output 211 200 psMetadataAdd (recipe, PS_LIST_TAIL, "SKYBIAS", PS_DATA_F32 | PS_META_REPLACE, "aperture sky bias", 0.0); 212 psMetadataAdd (recipe, PS_LIST_TAIL, "SKYSAT", PS_DATA_F32 | PS_META_REPLACE, "aperture sky bias", 0.0);201 psMetadataAdd (recipe, PS_LIST_TAIL, "SKYSAT", PS_DATA_F32 | PS_META_REPLACE, "aperture-determined saturation", 0.0); 213 202 psMetadataAdd (recipe, PS_LIST_TAIL, "APMIFIT", PS_DATA_F32 | PS_META_REPLACE, "aperture residual", psf->ApResid); 214 203 psMetadataAdd (recipe, PS_LIST_TAIL, "DAPMIFIT", PS_DATA_F32 | PS_META_REPLACE, "ap residual scatter", psf->dApResid); 215 psMetadataAdd (recipe, PS_LIST_TAIL, "APLOSS", PS_DATA_F32 | PS_META_REPLACE, "ap residual scatter", psf->growth->apLoss);216 psMetadataAdd (recipe, PS_LIST_TAIL, "NAPMIFIT", PS_DATA_S32 | PS_META_REPLACE, " ap residual scatter", psf->nApResid);204 psMetadataAdd (recipe, PS_LIST_TAIL, "APLOSS", PS_DATA_F32 | PS_META_REPLACE, "aperture loss (mag)", psf->growth->apLoss); 205 psMetadataAdd (recipe, PS_LIST_TAIL, "NAPMIFIT", PS_DATA_S32 | PS_META_REPLACE, "number of apresid stars", psf->nApResid); 217 206 218 207 // psLogMsg ("psphot.apresid", PS_LOG_INFO, "measure full-frame aperture residuals for %d of %d objects: %f sec\n", Nkeep, Npsf, psTimerMark ("psphot")); … … 327 316 328 317 if (readout->image->numCols > readout->image->numRows) { 329 Nx = scale; 330 Ny = PS_MAX (1, Nx * (readout->image->numRows / (float) readout->image->numCols)); 318 Nx = scale; 319 float AR = readout->image->numRows / (float) readout->image->numCols; 320 Ny = (int) (Nx * AR + 0.5); 321 Ny = PS_MAX (1, Ny); 331 322 } else { 332 323 Ny = scale; 333 Nx = PS_MAX (1, Ny * (readout->image->numCols / (float) readout->image->numRows)); 324 float AR = readout->image->numRows / (float) readout->image->numCols; 325 Nx = (int) (Ny * AR + 0.5); 326 Nx = PS_MAX (1, Nx); 334 327 } 335 328
Note:
See TracChangeset
for help on using the changeset viewer.
