IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 6, 2009, 12:48:29 PM (17 years ago)
Author:
Paul Price
Message:

Moving hardwired ppStack values to recipe. Adjusting what's now ZP.MATCH to 0.3 from 0.5 --- not enough sources were getting through, resulting in errors for subtraction (can't find stamps, can't measure PSF).

Location:
trunk/psModules/src/objects
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmSourceMatch.c

    r23189 r23212  
    524524psVector *pmSourceMatchRelphot(const psArray *matches, // Array of matches
    525525                               const psVector *zp, // Zero points for each image (including airmass term)
    526                                int maxIter, // Maximum number of iterations
    527526                               float tol, // Relative tolerance for convergence
     527                               int iter1, // Number of iterations for pass 1
     528                               float rej1, // Limit on rejection between iterations for pass 1
     529                               float sys1, // Systematic error in measurements for pass 1
     530                               int iter2, // Number of iterations for pass 2
     531                               float rej2, // Limit on rejection between iterations for pass 2
     532                               float sys2, // Systematic error in measurements for pass 2
    528533                               float rejLimit, // Limit on rejection between iterations
    529534                               int transIter, // Clipping iterations for transparency
    530535                               float transClip, // Clipping level for transparency
    531                                float photoLevel, // Level at which we declare image is photometric
    532                                float starClip, // Clipping for stars
    533                                float sysErr // Systematic error in measurements
     536                               float photoLevel // Level at which we declare image is photometric
    534537                               )
    535538{
     
    539542    PS_ASSERT_FLOAT_LARGER_THAN(transClip, 0.0, NULL);
    540543
    541     sysErr *= sysErr;
     544    sys1 *= sys1;
     545    sys2 *= sys2;
    542546
    543547    int numImages = zp->n;              // Number of images
     
    552556
    553557    float chi2 = sourceMatchRelphotIterate(trans, stars, badImage, matches, zp,
    554                                            photo, sysErr); // chi^2 for solution
     558                                           photo, sys1); // chi^2 for solution
    555559    psTrace("psModules.objects", 1, "Initial: chi^2 = %f\n", chi2);
    556560    float lastChi2 = INFINITY;          // chi^2 on last iteration
    557561    float fracRej = INFINITY;        // Fraction of measurements rejected
    558562
    559     // in the first passes, the transparencies are not well deteremined: use high systematic error and the rejection thresholds
    560     for (int i = 0; i < 5; i++) {
     563    // In the first passes, the transparencies are not well deteremined: use high systematic error and
     564    // rejection thresholds
     565    for (int i = 0; i < iter1; i++) {
    561566
    562567        // Identify photometric nights
     
    572577        psTrace("psModules.objects", 3, "Pass 1: Determined %d/%d are photometric", numPhoto, numImages);
    573578
    574         // XXX use 20 sigma rejection and 0.1 mag systematic error (move these to the recipe)
    575         fracRej = sourceMatchRelphotReject(trans, stars, matches, zp, photo, badImage, 20.0, PS_SQR(0.1));
     579        fracRej = sourceMatchRelphotReject(trans, stars, matches, zp, photo, badImage, rej1, sys1);
    576580        psTrace("psModules.objects", 3, "Pass 1: %f%% of measurements rejected", fracRej * 100);
    577581
    578         // XXX use 0.05 mag systematic error (move these to the recipe)
    579         chi2 = sourceMatchRelphotIterate(trans, stars, badImage, matches, zp, photo, PS_SQR(0.1));
     582        chi2 = sourceMatchRelphotIterate(trans, stars, badImage, matches, zp, photo, sys1);
    580583        psTrace("psModules.objects", 1, "Pass 1: iter = %d: chi^2 = %f rejected = %f\n", i, chi2, fracRej);
    581584    }
    582585
    583     for (int i = 0; i < maxIter && (fabsf(lastChi2 - chi2) > tol * chi2 || fracRej > rejLimit); i++) {
     586    for (int i = 0; i < iter2 && (fabsf(lastChi2 - chi2) > tol * chi2 || fracRej > rejLimit); i++) {
    584587        lastChi2 = chi2;
    585588
     
    594597            return NULL;
    595598        }
    596         psTrace("psModules.objects", 3, "Determined %d/%d are photometric", numPhoto, numImages);
    597 
    598         fracRej = sourceMatchRelphotReject(trans, stars, matches, zp, photo, badImage, starClip, sysErr);
    599         psTrace("psModules.objects", 3, "%f%% of measurements rejected", fracRej * 100);
    600 
    601         chi2 = sourceMatchRelphotIterate(trans, stars, badImage, matches, zp, photo, sysErr);
    602         psTrace("psModules.objects", 1, "iter = %d: chi^2 = %f rejected = %f\n", i, chi2, fracRej);
     599        psTrace("psModules.objects", 3, "Pass 2: Determined %d/%d are photometric", numPhoto, numImages);
     600
     601        fracRej = sourceMatchRelphotReject(trans, stars, matches, zp, photo, badImage, rej2, sys2);
     602        psTrace("psModules.objects", 3, "Pass 2: %f%% of measurements rejected", fracRej * 100);
     603
     604        chi2 = sourceMatchRelphotIterate(trans, stars, badImage, matches, zp, photo, sys2);
     605        psTrace("psModules.objects", 1, "Pass 2: iter = %d: chi^2 = %f rejected = %f\n", i, chi2, fracRej);
    603606    }
    604607
  • trunk/psModules/src/objects/pmSourceMatch.h

    r20953 r23212  
    5555psVector *pmSourceMatchRelphot(const psArray *matches, // Array of matches
    5656                               const psVector *zp, // Zero points for each image (including airmass term)
    57                                int maxIter, // Maximum number of iterations
    5857                               float tol, // Relative tolerance for convergence
     58                               int iter1, // Number of iterations for pass 1
     59                               float rej1, // Limit on rejection between iterations for pass 1
     60                               float sys1, // Systematic error in measurements for pass 1
     61                               int iter2, // Number of iterations for pass 2
     62                               float rej2, // Limit on rejection between iterations for pass 2
     63                               float sys2, // Systematic error in measurements for pass 2
    5964                               float rejLimit, // Limit on rejection between iterations
    6065                               int transIter, // Clipping iterations for transparency
    6166                               float transClip, // Clipping level for transparency
    62                                float photoLevel, // Level at which we declare image is photometric
    63                                float starClip, // Clipping for stars
    64                                float sysErr // Systematic error in measurements
     67                               float photoLevel // Level at which we declare image is photometric
    6568    );
    6669
Note: See TracChangeset for help on using the changeset viewer.