IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25328


Ignore:
Timestamp:
Sep 10, 2009, 3:54:56 PM (17 years ago)
Author:
Paul Price
Message:

Renaming 'fake' to 'efficiency' --- it's not so much about the fake sources, but the efficiency (for which we use fake sources).

Location:
branches/pap
Files:
4 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/pap/ippconfig/recipes/psphot.config

    r25311 r25328  
    265265PSPHOT.CR.NSIGMA.SOFTEN             F32   0.0025          # Softening parameter for weights
    266266
    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
     268EFF.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
    271270
    272271# Recipe overrides for CHIP
  • branches/pap/psphot/src/Makefile.am

    r25246 r25328  
    129129        psphotThreadTools.c            \
    130130        psphotAddNoise.c               \
    131         psphotFake.c
     131        psphotEfficiency.c
    132132
    133133# dropped? psphotGrowthCurve.c
  • branches/pap/psphot/src/psphot.h

    r25302 r25328  
    7676bool            psphotExtendedSourceAnalysis (pmReadout *readout, psArray *sources, psMetadata *recipe);
    7777bool            psphotExtendedSourceFits (pmReadout *readout, psArray *sources, psMetadata *recipe);
    78 bool            psphotFake(pmConfig *config, pmReadout *readout, const pmFPAview *view, const pmPSF *psf, psMetadata *recipe, const psArray *realSources);
     78bool            psphotEfficiency(pmConfig *config, pmReadout *readout, const pmFPAview *view, const pmPSF *psf, psMetadata *recipe, const psArray *realSources);
    7979
    8080// thread-related:
  • branches/pap/psphot/src/psphotEfficiency.c

    r25327 r25328  
    1111// We limit ourselves to calculating the peak flux in the smoothed image, which should be close (modulo
    1212// non-Gaussian PSF) to the limiting flux in the un-smoothed original image.
    13 static bool fakeLimit(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                       )
     13static 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                     )
    2424{
    2525    PM_ASSERT_READOUT_NON_NULL(ro, false);
     
    8383
    8484/// Generate a fake image and add it in to the existing readout
    85 static bool fakeGenerate(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                          )
     85static 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                        )
    9494{
    9595    PM_ASSERT_READOUT_NON_NULL(ro, false);
     
    148148
    149149
    150 // *** in this section, perform the photometry for fake sources ***
    151 bool psphotFake(pmConfig *config, pmReadout *readout, const pmFPAview *view, const pmPSF *psf,
     150// Determine detection efficiency
     151bool psphotEfficiency(pmConfig *config, pmReadout *readout, const pmFPAview *view, const pmPSF *psf,
    152152                psMetadata *recipe, const psArray *realSources)
    153153{
     
    177177        return false;
    178178    }
    179     psVector *magOffsets = psMetadataLookupVector(NULL, recipe, "FAKE.MAG"); // Magnitude offsets
     179    psVector *magOffsets = psMetadataLookupVector(NULL, recipe, "EFF.MAG"); // Magnitude offsets
    180180    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");
    182182        return NULL;
    183183    }
    184     int numSources = psMetadataLookupS32(NULL, recipe, "FAKE.NUM"); // Number of sources for each bin
     184    int numSources = psMetadataLookupS32(NULL, recipe, "EFF.NUM"); // Number of sources for each bin
    185185    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");
    187187        return NULL;
    188188    }
     
    220220    float minFlux;                      // Minimum flux for fake sources
    221221    float norm;                         // Normalisation of PSF
    222     if (!fakeLimit(&magLim, &radius, &minFlux, &norm, readout,
     222    if (!effLimit(&magLim, &radius, &minFlux, &norm, readout,
    223223                   psf, thresh, smoothSigma, smoothNsigma, maskVal)) {
    224224        psError(PS_ERR_UNKNOWN, false, "Unable to determine limits for image");
     
    233233
    234234    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)) {
    236236        psError(PS_ERR_UNKNOWN, false, "Unable to generate fake sources");
    237237        psFree(xFake);
  • branches/pap/psphot/src/psphotReadout.c

    r25302 r25328  
    224224    psphotMagnitudes(config, readout, view, sources, psf);
    225225
    226     if (!psphotFake(config, readout, view, psf, recipe, sources)) {
     226    if (!psphotEfficiency(config, readout, view, psf, recipe, sources)) {
    227227        psErrorStackPrint(stderr, "Unable to determine detection efficiencies from fake sources");
    228228        psErrorClear();
Note: See TracChangeset for help on using the changeset viewer.