Changeset 10185
- Timestamp:
- Nov 24, 2006, 11:06:14 AM (20 years ago)
- Location:
- trunk/psphot/src
- Files:
-
- 5 edited
-
psphot.c (modified) (1 diff)
-
psphot.h (modified) (2 diffs)
-
psphotMagnitudes.c (modified) (3 diffs)
-
psphotOutput.c (modified) (1 diff)
-
psphotReadout.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphot.c
r9515 r10185 28 28 } 29 29 30 // XXX for test checking of the config system 31 // psphotDumpConfig (config); 32 30 33 // call psphot for each readout 31 34 if (!psphotImageLoop (config)) { -
trunk/psphot/src/psphot.h
r10139 r10185 44 44 bool psphotReplaceUnfit (psArray *sources); 45 45 bool psphotApResid (pmReadout *readout, psArray *sources, psMetadata *recipe, pmPSF *psf); 46 bool psphotMagnitudes (psArray *sources, psMetadata *recipe, pmPSF *psf, const pmConfig *config);46 bool psphotMagnitudes (psArray *sources, psMetadata *recipe, pmPSF *psf, pmReadout *background); 47 47 bool psphotSkyReplace (pmConfig *config, pmFPAview *view); 48 48 bool psphotReadoutCleanup (pmConfig *config, pmReadout *readout, psMetadata *recipe, pmPSF *psf, psArray *sources); … … 69 69 bool psphotWeightBias (pmReadout *readout, psArray *sources, psMetadata *recipe, pmPSF *psf); 70 70 int psphotSaveImage (psMetadata *header, psImage *image, char *filename); 71 bool psphotDumpConfig (pmConfig *config); 72 pmReadout *psphotSelectBackground (pmConfig *config, pmFPAview *view); 71 73 72 74 // PSF / DBL / EXT evaluation functions -
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 } -
trunk/psphot/src/psphotOutput.c
r10096 r10185 1 1 # include "psphot.h" 2 3 pmReadout *psphotSelectBackground (pmConfig *config, pmFPAview *view) { 4 5 bool status; 6 pmReadout *background; 7 8 pmFPAfile *file = psMetadataLookupPtr (&status, config->files, "PSPHOT.BACKMDL"); 9 if (!file) return NULL; 10 if (file->mode == PM_FPA_MODE_INTERNAL) { 11 background = file->readout; 12 } else { 13 background = pmFPAviewThisReadout (view, file->fpa); 14 } 15 return background; 16 } 17 18 bool psphotDumpConfig (pmConfig *config) { 19 20 psMetadataConfigWrite (config->site, "site.md"); 21 psMetadataConfigWrite (config->camera, "camera.md"); 22 psMetadataConfigWrite (config->recipes, "recipes.md"); 23 psMetadataConfigWrite (config->arguments, "arguments.md"); 24 psMetadataConfigWrite (config->files, "files.md"); 25 return true; 26 } 2 27 3 28 int psphotSaveImage (psMetadata *header, psImage *image, char *filename) { -
trunk/psphot/src/psphotReadout.c
r10138 r10185 32 32 // generate a background model (median, smoothed image) 33 33 psphotImageMedian (config, view); 34 35 pmReadout *background = psphotSelectBackground (config, view); 34 36 35 37 // find the peaks in the image … … 111 113 112 114 // calculate source magnitudes 113 psphotMagnitudes(sources, recipe, psf, config);115 psphotMagnitudes(sources, recipe, psf, background); 114 116 115 117 // replace background in residual image
Note:
See TracChangeset
for help on using the changeset viewer.
