Changeset 26894 for trunk/psphot/src/psphotForcedReadout.c
- Timestamp:
- Feb 10, 2010, 7:36:29 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotForcedReadout.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotForcedReadout.c
r25981 r26894 20 20 21 21 // set the photcode for this image 22 if (!psphotAddPhotcode ( recipe, config, view, "PSPHOT.INPUT")) {22 if (!psphotAddPhotcode (config, view)) { 23 23 psError (PSPHOT_ERR_CONFIG, false, "trouble defining the photcode"); 24 24 return false; 25 25 } 26 27 // find the currently selected readout28 pmReadout *readout = pmFPAfileThisReadout (config->files, view, "PSPHOT.INPUT");29 PS_ASSERT_PTR_NON_NULL (readout, false);30 26 31 27 // optional break-point for processing … … 34 30 35 31 // Generate the mask and weight images, including the user-defined analysis region of interest 36 psphotSetMaskAndVariance (config, readout, recipe);32 psphotSetMaskAndVariance (config, view); 37 33 if (!strcasecmp (breakPt, "NOTHING")) { 38 return psphotReadoutCleanup(config, readout, recipe, NULL, NULL, NULL);34 return psphotReadoutCleanup(config, view); 39 35 } 40 36 41 // display the image, weight, mask (ch 1,2,3)42 psphotVisualShowImage (readout);43 44 37 // generate a background model (median, smoothed image) 45 if (!psphotModelBackground (config, view , "PSPHOT.INPUT")) {46 return psphotReadoutCleanup (config, readout, recipe, NULL, NULL, NULL);38 if (!psphotModelBackground (config, view)) { 39 return psphotReadoutCleanup (config, view); 47 40 } 48 if (!psphotSubtractBackground (config, view , "PSPHOT.INPUT")) {49 return psphotReadoutCleanup (config, readout, recipe, NULL, NULL, NULL);41 if (!psphotSubtractBackground (config, view)) { 42 return psphotReadoutCleanup (config, view); 50 43 } 51 44 if (!strcasecmp (breakPt, "BACKMDL")) { 52 return psphotReadoutCleanup (config, readout, recipe, NULL, NULL, NULL);45 return psphotReadoutCleanup (config, view); 53 46 } 54 47 55 // display the backsub and backgnd images 56 psphotVisualShowBackground (config, view, readout); 57 58 // load the psf model, if suppled. FWHM_X,FWHM_Y,etc are saved in the recipe 59 pmPSF *psf = psphotLoadPSF (config, view, recipe); 60 if (!psf) { 61 psError(PSPHOT_ERR_CONFIG, false, "unable to load psf model"); 62 return false; 48 if (!psphotLoadPSF (config, view)) { 49 // this only happens if we had a programming error in psphotLoadPSF 50 psError (PSPHOT_ERR_UNKNOWN, false, "error loading psf model"); 51 return psphotReadoutCleanup (config, view); 63 52 } 64 53 65 54 // include externally-supplied sources 66 psArray *sources = psArrayAllocEmpty(100); 67 psphotLoadExtSources (config, view, sources); 55 psphotLoadExtSources (config, view); 68 56 69 57 // construct an initial model for each object, set the radius to fitRadius, set circular fit mask 70 psphotGuessModels (config, readout, sources, psf);58 psphotGuessModels (config, view); 71 59 72 60 // linear PSF fit to source peaks, subtract the models from the image (in PSF mask) 73 psphotFitSourcesLinear ( readout, sources, recipe, psf, FALSE);61 psphotFitSourcesLinear (config, view, false); 74 62 75 63 // identify CRs and extended sources … … 79 67 80 68 // calculate source magnitudes 81 psphotMagnitudes(config, readout, view, sources, psf);69 psphotMagnitudes(config, view); 82 70 83 71 // XXX do I want to do this? … … 91 79 92 80 // drop the references to the image pixels held by each source 93 psphotSourceFreePixels ( sources);81 psphotSourceFreePixels (config, view); 94 82 95 83 // create the exported-metadata and free local data 96 return psphotReadoutCleanup(config, readout, recipe, NULL, psf, sources);84 return psphotReadoutCleanup(config, view); 97 85 }
Note:
See TracChangeset
for help on using the changeset viewer.
