- Timestamp:
- Jan 26, 2010, 5:10:34 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/psphot.stack.20100120/src/psphotEfficiency.c
r26266 r26688 149 149 150 150 151 bool psphotEfficiency (pmConfig *config, const pmFPAview *view) 152 { 153 bool status = true; 154 155 // select the appropriate recipe information 156 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE); 157 psAssert (recipe, "missing recipe?"); 158 159 int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 160 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 161 162 // loop over the available readouts 163 for (int i = 0; i < num; i++) { 164 if (!psphotReadout (config, view, "PSPHOT.INPUT", i, recipe)) { 165 psError (PSPHOT_ERR_CONFIG, false, "failed on saturated star deblend analysis for PSPHOT.INPUT entry %d", i); 166 return false; 167 } 168 } 169 return true; 170 } 171 151 172 // Determine detection efficiency 152 bool psphotEfficiency(pmConfig *config, pmReadout *readout, const pmFPAview *view, const pmPSF *psf, 153 psMetadata *recipe, const psArray *realSources) 173 bool psphotEfficiencyReadout(pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe) 154 174 { 175 psTimerStart("psphot.fake"); 176 177 // find the currently selected readout 178 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest 179 psAssert (readout, "missing file?"); 180 181 pmReadout *readout = pmFPAviewThisReadout(view, file->fpa); 182 psAssert (readout, "missing readout?"); 183 184 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); 185 psAssert (detections, "missing detections?"); 186 187 psArray *realSources = detections->allSources; 188 psAssert (realSources, "missing sources?"); 189 190 // XXX do we need to skip this step if we do not have a psf? 191 pmPSF *psf = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF"); 192 psAssert (psf, "missing psf?"); 193 155 194 PM_ASSERT_READOUT_NON_NULL(readout, false); 156 195 PM_ASSERT_READOUT_IMAGE(readout, false); 157 196 PS_ASSERT_PTR_NON_NULL(psf, false); 158 197 PS_ASSERT_METADATA_NON_NULL(recipe, false); 159 PS_ASSERT_ARRAY_NON_NULL(realSources, false);160 161 psTimerStart("psphot.fake");162 198 163 199 // Collect recipe information … … 202 238 // remove all sources, adding noise for subtracted sources 203 239 psphotRemoveAllSources(realSources, recipe); 204 // psphotAddNoise(readout, realSources, recipe);240 // psphotAddNoise(readout, realSources, recipe); 205 241 206 242
Note:
See TracChangeset
for help on using the changeset viewer.
