Changeset 26894 for trunk/psphot/src/psphotEfficiency.c
- Timestamp:
- Feb 10, 2010, 7:36:29 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotEfficiency.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotEfficiency.c
r26453 r26894 6 6 //#define TESTING 7 7 8 9 # if 0 8 10 9 11 // Calculate the limiting magnitude for an image … … 33 35 34 36 psKernel *kernel = psImageSmoothKernel(smoothSigma, smoothNsigma); // Kernel used for smoothing 35 psKernel *newCovar = psImageCovarianceCalculate(kernel, ro->covariance); // Covariance matrix37 *covarFactor = psImageCovarianceCalculateFactor(kernel, ro->covariance); 36 38 psFree(kernel); 37 *covarFactor = psImageCovarianceFactor(newCovar); // Variance factor38 psFree(newCovar);39 39 40 40 psStats *stats = psStatsAlloc(PS_STAT_ROBUST_MEDIAN); // Statistics for variance … … 152 152 } 153 153 154 # endif 155 156 bool psphotEfficiency (pmConfig *config, const pmFPAview *view) 157 { 158 bool status = true; 159 160 // select the appropriate recipe information 161 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE); 162 psAssert (recipe, "missing recipe?"); 163 164 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 165 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 166 167 // loop over the available readouts 168 for (int i = 0; i < num; i++) { 169 if (!psphotEfficiencyReadout (config, view, "PSPHOT.INPUT", i, recipe)) { 170 psError (PSPHOT_ERR_CONFIG, false, "failed to measure detection efficiency for PSPHOT.INPUT entry %d", i); 171 return false; 172 } 173 } 174 return true; 175 } 154 176 155 177 // Determine detection efficiency 156 bool psphotEfficiency(pmConfig *config, pmReadout *readout, const pmFPAview *view, const pmPSF *psf, 157 psMetadata *recipe, const psArray *realSources) 178 bool psphotEfficiencyReadout(pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe) 158 179 { 180 # if 0 181 bool status = true; 182 183 psTimerStart("psphot.fake"); 184 185 // find the currently selected readout 186 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest 187 psAssert (file, "missing file?"); 188 189 pmReadout *readout = pmFPAviewThisReadout(view, file->fpa); 190 psAssert (readout, "missing readout?"); 191 192 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); 193 psAssert (detections, "missing detections?"); 194 195 psArray *realSources = detections->allSources; 196 psAssert (realSources, "missing sources?"); 197 198 // XXX do we need to skip this step if we do not have a psf? 199 pmPSF *psf = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF"); 200 psAssert (psf, "missing psf?"); 201 159 202 PM_ASSERT_READOUT_NON_NULL(readout, false); 160 203 PM_ASSERT_READOUT_IMAGE(readout, false); 161 204 PS_ASSERT_PTR_NON_NULL(psf, false); 162 205 PS_ASSERT_METADATA_NON_NULL(recipe, false); 163 PS_ASSERT_ARRAY_NON_NULL(realSources, false);164 165 psTimerStart("psphot.fake");166 206 167 207 // Collect recipe information … … 206 246 // remove all sources, adding noise for subtracted sources 207 247 psphotRemoveAllSources(realSources, recipe); 208 // psphotAddNoise(readout, realSources, recipe);248 // psphotAddNoise(readout, realSources, recipe); 209 249 210 250 … … 480 520 psLogMsg("psphot", PS_LOG_INFO, "Detection efficiency: %lf sec\n", psTimerClear("psphot.fake")); 481 521 522 # endif 482 523 483 524 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
