- Timestamp:
- Feb 5, 2010, 1:38:43 PM (16 years ago)
- Location:
- branches/eam_branches/20091201/psphot
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/psphotEfficiency.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20091201/psphot
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/eam_branches/psphot.stack.20100120 merged eligible /branches/eam_branches/20091113/psphot 26119-26255
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/eam_branches/20091201/psphot/src/psphotEfficiency.c
r26705 r26788 6 6 //#define TESTING 7 7 8 9 # if 0 8 10 9 11 // Calculate the limiting magnitude for an image … … 146 148 } 147 149 150 # endif 151 152 bool psphotEfficiency (pmConfig *config, const pmFPAview *view) 153 { 154 bool status = true; 155 156 // select the appropriate recipe information 157 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE); 158 psAssert (recipe, "missing recipe?"); 159 160 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 161 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 162 163 // loop over the available readouts 164 for (int i = 0; i < num; i++) { 165 if (!psphotEfficiencyReadout (config, view, "PSPHOT.INPUT", i, recipe)) { 166 psError (PSPHOT_ERR_CONFIG, false, "failed to measure detection efficiency for PSPHOT.INPUT entry %d", i); 167 return false; 168 } 169 } 170 return true; 171 } 148 172 149 173 // Determine detection efficiency 150 bool psphotEfficiency(pmConfig *config, pmReadout *readout, const pmFPAview *view, const pmPSF *psf, 151 psMetadata *recipe, const psArray *realSources) 174 bool psphotEfficiencyReadout(pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe) 152 175 { 176 # if 0 177 bool status = true; 178 179 psTimerStart("psphot.fake"); 180 181 // find the currently selected readout 182 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest 183 psAssert (file, "missing file?"); 184 185 pmReadout *readout = pmFPAviewThisReadout(view, file->fpa); 186 psAssert (readout, "missing readout?"); 187 188 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); 189 psAssert (detections, "missing detections?"); 190 191 psArray *realSources = detections->allSources; 192 psAssert (realSources, "missing sources?"); 193 194 // XXX do we need to skip this step if we do not have a psf? 195 pmPSF *psf = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF"); 196 psAssert (psf, "missing psf?"); 197 153 198 PM_ASSERT_READOUT_NON_NULL(readout, false); 154 199 PM_ASSERT_READOUT_IMAGE(readout, false); 155 200 PS_ASSERT_PTR_NON_NULL(psf, false); 156 201 PS_ASSERT_METADATA_NON_NULL(recipe, false); 157 PS_ASSERT_ARRAY_NON_NULL(realSources, false);158 159 psTimerStart("psphot.fake");160 202 161 203 // Collect recipe information … … 200 242 // remove all sources, adding noise for subtracted sources 201 243 psphotRemoveAllSources(realSources, recipe); 202 // psphotAddNoise(readout, realSources, recipe);244 // psphotAddNoise(readout, realSources, recipe); 203 245 204 246 … … 474 516 psLogMsg("psphot", PS_LOG_INFO, "Detection efficiency: %lf sec\n", psTimerClear("psphot.fake")); 475 517 518 # endif 476 519 477 520 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
