Changeset 10138
- Timestamp:
- Nov 22, 2006, 4:27:40 AM (20 years ago)
- Location:
- trunk/psphot/src
- Files:
-
- 2 edited
-
psphotMagnitudes.c (modified) (3 diffs)
-
psphotReadout.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotMagnitudes.c
r9994 r10138 1 1 # include "psphot.h" 2 2 3 bool psphotMagnitudes (psArray *sources, psMetadata *recipe, pmPSF *psf) { 4 3 bool psphotMagnitudes(psArray *sources, 4 psMetadata *recipe, 5 pmPSF *psf, 6 const pmConfig *config) 7 { 5 8 bool status = false; 6 9 int Nap = 0; … … 9 12 10 13 pmSourceMagnitudesInit (recipe); 14 15 // Get enough information to return sky level 16 assert (config != NULL); 17 const psImage *background = NULL; 18 int DX = 0, DY = 0, dx = 0, dy = 0; // unpacked with PSPHOT.BACKMDL 19 { 20 const pmFPAfile *backgroundFile = psMetadataLookupPtr(&status, config->files, "PSPHOT.BACKMDL"); 21 if (backgroundFile != NULL) { 22 assert (backgroundFile->readout != NULL); 23 background = backgroundFile->readout->image; 24 25 assert(backgroundFile->readout->analysis != NULL); 26 DX = psMetadataLookupS32(&status, backgroundFile->readout->analysis, "XBIN"); 27 assert (status == true); 28 DY = psMetadataLookupS32(&status, backgroundFile->readout->analysis, "YBIN"); 29 assert (status == true); 30 dx = psMetadataLookupS32(&status, backgroundFile->readout->analysis, "x0"); 31 assert (status == true); 32 dy = psMetadataLookupS32(&status, backgroundFile->readout->analysis, "y0"); 33 assert (status == true); 34 } 35 } 11 36 12 37 bool IGNORE_GROWTH = psMetadataLookupBool (&status, recipe, "IGNORE_GROWTH"); … … 21 46 status = pmSourceMagnitudes (source, psf, photMode); 22 47 if (status) Nap ++; 48 49 source->sky = 0; 50 #if 0 51 source->sky += source->moments->Sky; 52 #endif 53 54 if (background != NULL) { 55 source->sky += psImageUnbinPixel(source->peak->x, source->peak->y, background, DX, DY, dx, dy); 56 if (isnan(source->sky) && false) { 57 psError(PSPHOT_ERR_SKY, false, "Setting pmSource.sky"); 58 psErrorStackPrint(NULL, " "); 59 psErrorClear(); 60 } 61 } 23 62 } 24 63 -
trunk/psphot/src/psphotReadout.c
r10052 r10138 111 111 112 112 // calculate source magnitudes 113 psphotMagnitudes (sources, recipe, psf);113 psphotMagnitudes(sources, recipe, psf, config); 114 114 115 115 // replace background in residual image
Note:
See TracChangeset
for help on using the changeset viewer.
