IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25313


Ignore:
Timestamp:
Sep 10, 2009, 11:15:20 AM (17 years ago)
Author:
Paul Price
Message:

Nigel Metcalfe points out that we shouldn't use extended sources as stamps when convolving to a target PSF. To avoid this, I'm throwing out extended sources when I create the fake image. This requires an API change to pmReadoutFake(). I think I've caught all instances that use that.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src/ppStackMatch.c

    r25256 r25313  
    1414#define FAKE_SIZE 1                     // Size of fake convolution kernel
    1515#define SOURCE_MASK (PM_SOURCE_MODE_FAIL | PM_SOURCE_MODE_DEFECT | PM_SOURCE_MODE_SATURATED | \
    16                      PM_SOURCE_MODE_CR_LIMIT) // Mask to apply to input sources
     16                     PM_SOURCE_MODE_CR_LIMIT | PM_SOURCE_MODE_EXT_LIMIT) // Mask to apply to input sources
    1717#define FAINT_SOURCE_FRAC 1.0e-4         // Set minimum flux to this fraction of faintest source flux
    1818#define COVAR_FRAC 0.01                 // Truncation fraction for covariance matrix
     
    288288
    289289            if (!pmReadoutFakeFromSources(fake, readout->image->numCols, readout->image->numRows,
    290                                           stampSources, NULL, NULL, options->psf, NAN, footprint + size,
    291                                           false, true)) {
     290                                          stampSources, SOURCE_MASK, NULL, NULL, options->psf,
     291                                          NAN, footprint + size, false, true)) {
    292292                psError(PS_ERR_UNKNOWN, false, "Unable to generate fake image with target PSF.");
    293293                psFree(fake);
  • trunk/ppStack/src/ppStackSources.c

    r23573 r25313  
    123123        pmReadout *fake = pmReadoutAlloc(NULL); // Fake readout
    124124        pmPSF *psf = psMetadataLookupPtr(NULL, config->arguments, "PSF.TARGET"); // PSF for fake image
    125         pmReadoutFakeFromSources(fake, FAKE_COLS, FAKE_ROWS, sourceLists->data[i],
     125        pmReadoutFakeFromSources(fake, FAKE_COLS, FAKE_ROWS, sourceLists->data[i], 0,
    126126                                 NULL, NULL, psf, 5, 0, false, true);
    127127        psString name = NULL;
  • trunk/psModules/src/camera/pmReadoutFake.c

    r25299 r25313  
    2828#define MODEL_TYPE "PS_MODEL_RGAUSS"    // Type of model to use
    2929#define MAX_AXIS_RATIO 20.0             // Maximum axis ratio for PSF model
    30 #define SOURCE_MASK (PM_SOURCE_MODE_DEFECT | PM_SOURCE_MODE_CR_LIMIT) // Mask to apply to input sources
    3130#define MODEL_MASK (PM_MODEL_STATUS_NONCONVERGE | PM_MODEL_STATUS_OFFIMAGE | \
    3231                    PM_MODEL_STATUS_BADARGS | PM_MODEL_STATUS_LIMITS) // Mask to apply to models
     
    162161
    163162bool pmReadoutFakeFromSources(pmReadout *readout, int numCols, int numRows, const psArray *sources,
    164                               const psVector *xOffset, const psVector *yOffset, const pmPSF *psf,
    165                               float minFlux, int radius, bool circularise, bool normalisePeak)
     163                              pmSourceMode sourceMask, const psVector *xOffset, const psVector *yOffset,
     164                              const pmPSF *psf, float minFlux, int radius,
     165                              bool circularise, bool normalisePeak)
    166166{
    167167    PS_ASSERT_ARRAY_NON_NULL(sources, false);
     
    178178            continue;
    179179        }
    180         if (source->mode & SOURCE_MASK) {
     180        if (source->mode & sourceMask) {
    181181            continue;
    182182        }
  • trunk/psModules/src/camera/pmReadoutFake.h

    r20999 r25313  
    1111#include <pmTrend2D.h>
    1212#include <pmPSF.h>
     13#include <pmSourceMasks.h>
    1314
    1415/// Generate a fake readout from an array of sources
     
    1617                              int numCols, int numRows, ///< Dimension of image
    1718                              const psArray *sources, ///< Array of pmSource
     19                              pmSourceMode sourceMask, ///< Mask for sources
    1820                              const psVector *xOffset, ///< x offsets for sources (source -> img), or NULL
    1921                              const psVector *yOffset, ///< y offsets for sources (source -> img), or NULL
  • trunk/psModules/src/imcombine/pmPSFEnvelope.c

    r24622 r25313  
    124124        pmResiduals *resid = psf->residuals;// PSF residuals
    125125        psf->residuals = NULL;
    126         if (!pmReadoutFakeFromSources(fakeRO, fakeSize, fakeSize, fakes, xOffset, yOffset, psf,
     126        if (!pmReadoutFakeFromSources(fakeRO, fakeSize, fakeSize, fakes, 0, xOffset, yOffset, psf,
    127127                                      NAN, radius, true, true)) {
    128128            psError(PS_ERR_UNKNOWN, false, "Unable to generate fake readout.");
     
    298298        }
    299299
    300         // measure the source moments: tophat windowing, no pixel S/N cutoff
     300        // measure the source moments: tophat windowing, no pixel S/N cutoff
    301301        if (!pmSourceMoments(source, maxRadius, 0.0, 1.0)) {
    302302            // Can't do anything about it; limp along as best we can
Note: See TracChangeset for help on using the changeset viewer.