Changeset 25328
- Timestamp:
- Sep 10, 2009, 3:54:56 PM (17 years ago)
- Location:
- branches/pap
- Files:
-
- 4 edited
- 1 moved
-
ippconfig/recipes/psphot.config (modified) (1 diff)
-
psphot/src/Makefile.am (modified) (1 diff)
-
psphot/src/psphot.h (modified) (1 diff)
-
psphot/src/psphotEfficiency.c (moved) (moved from branches/pap/psphot/src/psphotFake.c ) (6 diffs)
-
psphot/src/psphotReadout.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap/ippconfig/recipes/psphot.config
r25311 r25328 265 265 PSPHOT.CR.NSIGMA.SOFTEN F32 0.0025 # Softening parameter for weights 266 266 267 # Fake sources for detection efficiency 268 FAKE.NUM S32 500 # Number of fake sources per bin 269 @FAKE.MAG F32 -2.0 -1.0 -0.5 0.0 0.5 1.0 # Magnitude of fake sources relative to limit 270 267 # Detection efficiency 268 EFF.NUM S32 500 # Number of fake sources per bin 269 @EFF.MAG F32 -2.0 -1.0 -0.5 0.0 0.5 1.0 # Magnitude of fake sources relative to limit 271 270 272 271 # Recipe overrides for CHIP -
branches/pap/psphot/src/Makefile.am
r25246 r25328 129 129 psphotThreadTools.c \ 130 130 psphotAddNoise.c \ 131 psphot Fake.c131 psphotEfficiency.c 132 132 133 133 # dropped? psphotGrowthCurve.c -
branches/pap/psphot/src/psphot.h
r25302 r25328 76 76 bool psphotExtendedSourceAnalysis (pmReadout *readout, psArray *sources, psMetadata *recipe); 77 77 bool psphotExtendedSourceFits (pmReadout *readout, psArray *sources, psMetadata *recipe); 78 bool psphot Fake(pmConfig *config, pmReadout *readout, const pmFPAview *view, const pmPSF *psf, psMetadata *recipe, const psArray *realSources);78 bool psphotEfficiency(pmConfig *config, pmReadout *readout, const pmFPAview *view, const pmPSF *psf, psMetadata *recipe, const psArray *realSources); 79 79 80 80 // thread-related: -
branches/pap/psphot/src/psphotEfficiency.c
r25327 r25328 11 11 // We limit ourselves to calculating the peak flux in the smoothed image, which should be close (modulo 12 12 // non-Gaussian PSF) to the limiting flux in the un-smoothed original image. 13 static bool fakeLimit(float *magLim, // Limiting magntiude, to return14 int *radius, // Radius for fake sources, to return15 float *minFlux, // Minimum flux for fake sources, to return16 float *norm, // Normalisation of PSF (conversion: peak --> integrated flux)17 const pmReadout *ro, // Readout of interest18 const pmPSF *psf, // Point-spread function19 float thresh, // Threshold for source identification20 float smoothSigma, // Gaussian smoothing sigma21 float smoothNsigma, // Smoothing limit22 psImageMaskType maskVal // Value to mask23 )13 static bool effLimit(float *magLim, // Limiting magntiude, to return 14 int *radius, // Radius for fake sources, to return 15 float *minFlux, // Minimum flux for fake sources, to return 16 float *norm, // Normalisation of PSF (conversion: peak --> integrated flux) 17 const pmReadout *ro, // Readout of interest 18 const pmPSF *psf, // Point-spread function 19 float thresh, // Threshold for source identification 20 float smoothSigma, // Gaussian smoothing sigma 21 float smoothNsigma, // Smoothing limit 22 psImageMaskType maskVal // Value to mask 23 ) 24 24 { 25 25 PM_ASSERT_READOUT_NON_NULL(ro, false); … … 83 83 84 84 /// Generate a fake image and add it in to the existing readout 85 static bool fakeGenerate(psImage **xSrc, psImage **ySrc, // Positions of sources86 const pmReadout *ro, // Readout of interest87 const pmPSF *psf, // Point-spread function88 const psVector *magOffsets, // Magnitude offsets for fake sources89 int numSources, // Number of fake sources for each bin90 float refMag, // Reference magnitude91 int radius, // Radius for fake sources92 float minFlux // Minimum flux for fake sources93 )85 static bool effGenerate(psImage **xSrc, psImage **ySrc, // Positions of sources 86 const pmReadout *ro, // Readout of interest 87 const pmPSF *psf, // Point-spread function 88 const psVector *magOffsets, // Magnitude offsets for fake sources 89 int numSources, // Number of fake sources for each bin 90 float refMag, // Reference magnitude 91 int radius, // Radius for fake sources 92 float minFlux // Minimum flux for fake sources 93 ) 94 94 { 95 95 PM_ASSERT_READOUT_NON_NULL(ro, false); … … 148 148 149 149 150 // *** in this section, perform the photometry for fake sources ***151 bool psphot Fake(pmConfig *config, pmReadout *readout, const pmFPAview *view, const pmPSF *psf,150 // Determine detection efficiency 151 bool psphotEfficiency(pmConfig *config, pmReadout *readout, const pmFPAview *view, const pmPSF *psf, 152 152 psMetadata *recipe, const psArray *realSources) 153 153 { … … 177 177 return false; 178 178 } 179 psVector *magOffsets = psMetadataLookupVector(NULL, recipe, " FAKE.MAG"); // Magnitude offsets179 psVector *magOffsets = psMetadataLookupVector(NULL, recipe, "EFF.MAG"); // Magnitude offsets 180 180 if (!magOffsets || magOffsets->type.type != PS_TYPE_F32) { 181 psError(PSPHOT_ERR_CONFIG, false, "Unable to find FAKE.MAG F32 vector in recipe");181 psError(PSPHOT_ERR_CONFIG, false, "Unable to find EFF.MAG F32 vector in recipe"); 182 182 return NULL; 183 183 } 184 int numSources = psMetadataLookupS32(NULL, recipe, " FAKE.NUM"); // Number of sources for each bin184 int numSources = psMetadataLookupS32(NULL, recipe, "EFF.NUM"); // Number of sources for each bin 185 185 if (numSources == 0) { 186 psError(PSPHOT_ERR_CONFIG, false, "Unable to find FAKE.NUM in recipe");186 psError(PSPHOT_ERR_CONFIG, false, "Unable to find EFF.NUM in recipe"); 187 187 return NULL; 188 188 } … … 220 220 float minFlux; // Minimum flux for fake sources 221 221 float norm; // Normalisation of PSF 222 if (! fakeLimit(&magLim, &radius, &minFlux, &norm, readout,222 if (!effLimit(&magLim, &radius, &minFlux, &norm, readout, 223 223 psf, thresh, smoothSigma, smoothNsigma, maskVal)) { 224 224 psError(PS_ERR_UNKNOWN, false, "Unable to determine limits for image"); … … 233 233 234 234 psImage *xFake = NULL, *yFake = NULL; // Coordinates of sources, each bin in a row 235 if (! fakeGenerate(&xFake, &yFake, readout, psf, magOffsets, numSources, magLim, radius, minFlux)) {235 if (!effGenerate(&xFake, &yFake, readout, psf, magOffsets, numSources, magLim, radius, minFlux)) { 236 236 psError(PS_ERR_UNKNOWN, false, "Unable to generate fake sources"); 237 237 psFree(xFake); -
branches/pap/psphot/src/psphotReadout.c
r25302 r25328 224 224 psphotMagnitudes(config, readout, view, sources, psf); 225 225 226 if (!psphot Fake(config, readout, view, psf, recipe, sources)) {226 if (!psphotEfficiency(config, readout, view, psf, recipe, sources)) { 227 227 psErrorStackPrint(stderr, "Unable to determine detection efficiencies from fake sources"); 228 228 psErrorClear();
Note:
See TracChangeset
for help on using the changeset viewer.
