IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 21017


Ignore:
Timestamp:
Dec 16, 2008, 2:31:05 PM (17 years ago)
Author:
Paul Price
Message:

Adding test for normalisation of pmReadoutFakeFromSources.

File:
1 edited

Legend:

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

    r21002 r21017  
    1616#define FAINT_SOURCE_FRAC 1.0e-4         // Set minimum flux to this fraction of faintest source flux
    1717
    18 //#define TESTING                         // Enable debugging output
     18#define TESTING                         // Enable debugging output
    1919
    2020#ifdef TESTING
     
    310310#endif
    311311
     312
     313#if 0
     314            // Testing the normalisation of the fake image
     315            {
     316                pmReadout *test = pmReadoutAlloc(NULL); // Test readout
     317                psArray *sources = psArrayAlloc(1);     // Array of sources
     318                pmSource *source = pmSourceAlloc();     // Source
     319                sources->data[0] = source;
     320                source->peak = pmPeakAlloc(50, 50, 10000, PM_PEAK_LONE);
     321                source->psfMag = -13.0;
     322                pmReadoutFakeFromSources(test, 100, 100, sources, NULL, NULL, psf, 0.1, 0, false, true);
     323                float sum = 0.0;
     324                for (int y = 0; y < test->image->numRows; y++) {
     325                    for (int x = 0; x < test->image->numCols; x++) {
     326                        sum += test->image->data.F32[y][x];
     327                    }
     328                }
     329                fprintf(stderr, "Photometry: %f --> %f = -13.0 ???\n", sum, -2.5*log10(sum));
     330
     331                psFits *fits = psFitsOpen("testphot.fits", "w");
     332                psFitsWriteImage(fits, NULL, test->image, 0, NULL);
     333                psFitsClose(fits);
     334                exit(0);
     335            }
     336#endif
     337
    312338            pmReadout *fake = pmReadoutAlloc(NULL); // Fake readout with target PSF
    313339
     
    316342
    317343            if (!pmReadoutFakeFromSources(fake, readout->image->numCols, readout->image->numRows,
    318                                           stampSources, NULL, NULL, psf, minFlux, 0, false, false)) {
     344                                          stampSources, NULL, NULL, psf, minFlux, 0, false, true)) {
    319345                psError(PS_ERR_UNKNOWN, false, "Unable to generate fake image with target PSF.");
    320346                psFree(fake);
Note: See TracChangeset for help on using the changeset viewer.