Changeset 10185 for trunk/psphot/src/psphotMagnitudes.c
- Timestamp:
- Nov 24, 2006, 11:06:14 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotMagnitudes.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotMagnitudes.c
r10138 r10185 4 4 psMetadata *recipe, 5 5 pmPSF *psf, 6 const pmConfig *config)6 pmReadout *background) 7 7 { 8 8 bool status = false; … … 13 13 pmSourceMagnitudesInit (recipe); 14 14 15 // XXX require (assert) that we have a background model, or 16 // allow it to be missing, setting local sky to 0.0? 17 15 18 // 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 } 19 assert(background != NULL); 20 assert(background->analysis != NULL); 21 int DX = psMetadataLookupS32(&status, background->analysis, "XBIN"); 22 assert (status == true); 23 int DY = psMetadataLookupS32(&status, background->analysis, "YBIN"); 24 assert (status == true); 25 int dx = psMetadataLookupS32(&status, background->analysis, "x0"); 26 assert (status == true); 27 int dy = psMetadataLookupS32(&status, background->analysis, "y0"); 28 assert (status == true); 36 29 37 30 bool IGNORE_GROWTH = psMetadataLookupBool (&status, recipe, "IGNORE_GROWTH"); … … 47 40 if (status) Nap ++; 48 41 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 } 42 source->sky = psImageUnbinPixel(source->peak->x, source->peak->y, background->image, DX, DY, dx, dy); 43 if (isnan(source->sky) && false) { 44 psError(PSPHOT_ERR_SKY, false, "Setting pmSource.sky"); 45 psErrorStackPrint(NULL, " "); 46 psErrorClear(); 61 47 } 62 48 }
Note:
See TracChangeset
for help on using the changeset viewer.
