Changeset 29936 for trunk/psphot/src/psphotReadoutFindPSF.c
- Timestamp:
- Dec 5, 2010, 9:42:25 PM (16 years ago)
- Location:
- trunk/psphot
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/psphotReadoutFindPSF.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20101103/psphot (added) merged: 29660,29824-29825,29904,29914,29918,29920
- Property svn:mergeinfo changed
-
trunk/psphot/src/psphotReadoutFindPSF.c
r28013 r29936 3 3 // in this psphotReadout-variant, we are only trying to determine the PSF given an existing set 4 4 // of input source positions to use as initial PSF stars. 5 bool psphotReadoutFindPSF(pmConfig *config, const pmFPAview *view, psArray *inSources) {5 bool psphotReadoutFindPSF(pmConfig *config, const pmFPAview *view, const char *filerule, psArray *inSources) { 6 6 7 7 psTimerStart ("psphotReadout"); 8 8 9 // set the photcode for the PSPHOT.INPUT10 if (!psphotAddPhotcode(config, view, "PSPHOT.INPUT")) {9 // set the photcode for the input 10 if (!psphotAddPhotcode(config, view, filerule)) { 11 11 psError(PSPHOT_ERR_CONFIG, false, "trouble defining the photcode"); 12 12 return false; … … 14 14 15 15 // Generate the mask and variance images, including the user-defined analysis region of interest 16 psphotSetMaskAndVariance (config, view, "PSPHOT.INPUT");16 psphotSetMaskAndVariance (config, view, filerule); 17 17 18 18 // Note that in this implementation, we do NOT model the background and we do not 19 19 // attempt to detect the sources in the image 20 20 21 // include externally-supplied sources (supplied as PSPHOT.INPUT.CMF)22 // XXX we assume a single set of input sources is supplied23 if (!psphotDetectionsFromSources (config, view, "PSPHOT.INPUT", inSources)) {21 // include the externally-supplied sources (inSources) 22 // (we assume a single set of input sources is supplied) 23 if (!psphotDetectionsFromSources (config, view, filerule, inSources)) { 24 24 psError(PSPHOT_ERR_ARGUMENTS, true, "Can't find PSF stars"); 25 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");25 return psphotReadoutCleanup (config, view, filerule); 26 26 } 27 27 28 28 // construct detections->newSources and measure basic stats (moments, local sky) 29 if (!psphotSourceStats(config, view, "PSPHOT.INPUT", true)) {29 if (!psphotSourceStats(config, view, filerule, true)) { 30 30 psError(PSPHOT_ERR_UNKNOWN, false, "failure to generate sources"); 31 31 return false; … … 33 33 34 34 // peak flux is wrong : use the peak measured in the moments analysis: 35 if (!psphotRepairLoadedSources(config, view, "PSPHOT.INPUT")) {35 if (!psphotRepairLoadedSources(config, view, filerule)) { 36 36 psError(PSPHOT_ERR_UNKNOWN, false, "failure to repair sources"); 37 37 return false; … … 39 39 40 40 // classify sources based on moments, brightness (psf is not known) 41 if (!psphotRoughClass (config, view, "PSPHOT.INPUT")) {41 if (!psphotRoughClass (config, view, filerule)) { 42 42 psError (PSPHOT_ERR_UNKNOWN, false, "failed to determine rough source class"); 43 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");43 return psphotReadoutCleanup (config, view, filerule); 44 44 } 45 45 46 if (!psphotImageQuality (config, view, "PSPHOT.INPUT")) {46 if (!psphotImageQuality (config, view, filerule)) { 47 47 psError (PSPHOT_ERR_UNKNOWN, false, "failed to measure image quality"); 48 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");48 return psphotReadoutCleanup (config, view, filerule); 49 49 } 50 50 51 if (!psphotChoosePSF(config, view, "PSPHOT.INPUT")) {51 if (!psphotChoosePSF(config, view, filerule)) { 52 52 psError(PSPHOT_ERR_PSF, false, "Failed to construct a psf model"); 53 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");53 return psphotReadoutCleanup (config, view, filerule); 54 54 } 55 55 … … 59 59 // fits from that analysis, or run the linear PSF fit for all objects currently in hand 60 60 // construct an initial model for each object, set the radius to fitRadius, set circular fit mask 61 psphotGuessModels (config, view, "PSPHOT.INPUT");61 psphotGuessModels (config, view, filerule); 62 62 # endif 63 63 64 64 // merge the newly selected sources into the existing list 65 65 // NOTE: merge OLD and NEW 66 psphotMergeSources (config, view, "PSPHOT.INPUT");66 psphotMergeSources (config, view, filerule); 67 67 68 68 # if 0 69 69 // measure aperture photometry corrections 70 if (!psphotApResid (config, view, "PSPHOT.INPUT")) {70 if (!psphotApResid (config, view, filerule)) { 71 71 psLogMsg ("psphot", 3, "failed on psphotApResid"); 72 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");72 return psphotReadoutCleanup (config, view, filerule); 73 73 } 74 74 # endif 75 75 76 76 // drop the references to the image pixels held by each source 77 psphotSourceFreePixels(config, view, "PSPHOT.INPUT");77 psphotSourceFreePixels(config, view, filerule); 78 78 79 79 // create the exported-metadata and free local data 80 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");80 return psphotReadoutCleanup (config, view, filerule); 81 81 }
Note:
See TracChangeset
for help on using the changeset viewer.
