- Timestamp:
- Dec 21, 2010, 3:01:12 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20101205/psphot/src/psphotStackReadout.c
r30101 r30141 10 10 // SRC (source analysis image) : nominally CNV (optionally RAW) 11 11 // OUT (psf-matched images) : always OUT 12 13 bool psphotStackVisualFilerule(pmConfig *config, const pmFPAview *view, const char *filerule) { 14 15 int num = psphotFileruleCount(config, filerule); 16 17 // loop over the available readouts 18 for (int i = 0; i < num; i++) { 19 20 // find the currently selected readout 21 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filerule, i); // File of interest 22 psAssert (file, "missing file?"); 23 24 pmReadout *readout = pmFPAviewThisReadout(view, file->fpa); 25 psAssert (readout, "missing readout?"); 26 27 psphotVisualShowImage (readout); 28 psphotVisualShowResidualImage (readout); 29 } 30 return true; 31 } 12 32 13 33 bool psphotStackReadout (pmConfig *config, const pmFPAview *view) { … … 92 112 } 93 113 114 if (!strcasecmp (breakPt, "TEST1")) { 115 return psphotReadoutCleanup (config, view, STACK_SRC); 116 } 117 94 118 // generate the objects (object unify the sources from the different images) 95 119 // XXX this could just match the detections for the chisq image, and not bother measuring the … … 97 121 psArray *objects = psphotMatchSources (config, view, STACK_SRC); 98 122 123 if (!strcasecmp (breakPt, "TEST2")) { 124 psFree(objects); 125 return psphotReadoutCleanup (config, view, STACK_SRC); 126 } 127 99 128 // construct sources for the newly-generated sources (from other images) 100 129 if (!psphotSourceStats (config, view, STACK_SRC, false)) { // pass 1 130 psFree(objects); 101 131 psError(PSPHOT_ERR_UNKNOWN, false, "failure to generate sources"); 102 132 return psphotReadoutCleanup (config, view, STACK_SRC); … … 118 148 // only run this on detections from the input images, not chisq image 119 149 if (!psphotRoughClass (config, view, STACK_SRC)) { 150 psFree(objects); 120 151 psError (PSPHOT_ERR_UNKNOWN, false, "failed to determine rough classifications"); 121 152 return psphotReadoutCleanup (config, view, STACK_SRC); … … 124 155 // only run this on detections from the input images, not chisq image 125 156 if (!psphotImageQuality (config, view, STACK_SRC)) { // pass 1 157 psFree(objects); 126 158 psError (PSPHOT_ERR_UNKNOWN, false, "failed to measure image quality"); 127 159 return psphotReadoutCleanup (config, view, STACK_SRC); 128 160 } 129 161 if (!strcasecmp (breakPt, "MOMENTS")) { 162 psFree(objects); 130 163 return psphotReadoutCleanup (config, view, STACK_SRC); 131 164 } … … 133 166 // use bright stellar objects to measure PSF if we were supplied a PSF for any input file, 134 167 // this step is skipped 135 if (!psphotChoosePSF (config, view, STACK_SRC)) { // pass 1 168 if (!psphotChoosePSF (config, view, STACK_SRC, true)) { // pass 1 169 psFree(objects); 136 170 psLogMsg ("psphot", 3, "failure to construct a psf model"); 137 171 return psphotReadoutCleanup (config, view, STACK_SRC); 138 172 } 139 173 if (!strcasecmp (breakPt, "PSFMODEL")) { 174 psFree(objects); 140 175 return psphotReadoutCleanup (config, view, STACK_SRC); 141 176 } … … 150 185 // linear PSF fit to source peaks, subtract the models from the image (in PSF mask) 151 186 psphotFitSourcesLinearStack (config, objects, FALSE); 187 psphotStackVisualFilerule(config, view, STACK_SRC); 152 188 153 189 // identify CRs and extended sources … … 174 210 // copy the detections from SRC to OUT (for radial aperture photometry) 175 211 if (!psphotCopySources (config, view, STACK_OUT, STACK_SRC)) { 212 psFree(objects); 176 213 psError (PSPHOT_ERR_UNKNOWN, false, "failure in peak analysis"); 177 214 return psphotReadoutCleanup (config, view, STACK_SRC); 178 215 } 179 // XXX need to do something to reassign the source pixels here180 216 181 217 bool smoothAgain = true; 182 218 for (int nMatchedPSF = 0; smoothAgain; nMatchedPSF++) { 219 psphotRedefinePixels (config, view, STACK_OUT); 220 221 psphotChoosePSF (config, view, STACK_OUT, false); 222 223 psphotResetModels (config, view, STACK_OUT); 224 225 psphotFitSourcesLinear (config, view, STACK_OUT, false); 226 183 227 // measure circular, radial apertures (objects sorted by S/N) 184 228 psphotRadialAperturesByObject (config, objects, view, STACK_OUT, nMatchedPSF); 229 230 psphotReplaceAllSources (config, view, STACK_OUT); 231 185 232 psphotStackMatchPSFsNext(&smoothAgain, config, view, STACK_OUT, nMatchedPSF); 186 233 }
Note:
See TracChangeset
for help on using the changeset viewer.
