IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 2, 2009, 10:45:54 AM (17 years ago)
Author:
eugene
Message:

sneak up on the non-photometric images to avoid rejecting all measurements for any image

File:
1 edited

Legend:

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

    r21183 r21266  
    6262    for (long i = 0; i < numSources; i++) {
    6363        pmSource *source = sources->data[i]; // Source of interest
    64         if (!source || (source->mode & SOURCE_MASK) || !isfinite(source->psfMag) ||
    65             !isfinite(source->errMag) || source->psfMag > SOURCE_FAINTEST) {
    66             continue;
    67         }
     64        if (!source) continue;
     65        if (source->mode & SOURCE_MASK) continue;
     66        if (!isfinite(source->psfMag)) continue;
     67        if (!isfinite(source->errMag)) continue;
     68        if (source->psfMag > SOURCE_FAINTEST) continue;
     69
    6870        float xSrc, ySrc;               // Coordinates of source
    6971        coordsFromSource(&xSrc, &ySrc, source);
     
    7678        (*y)->data.F32[num] = ySrc;
    7779        (*mag)->data.F32[num] = source->psfMag;
    78         (*magErr)->data.F32[num] = source->errMag;
     80        (*magErr)->data.F32[num] = source->errMag ;
    7981        num++;
    8082    }
     
    486488            }
    487489            float dev = mag + cal - stars->data.F32[i]; // Deviation
    488             if (PS_SQR(dev) > starClip * (PS_SQR(magErr) + sysErr2)) {
     490
     491            // only reject detections from photometric images (non-photometric images can
     492            // have large errors.  XXX Or: allow a much higher rejection threshold
     493            if (photo->data.U8[index]) {
     494              if (PS_SQR(dev) > starClip * (PS_SQR(magErr) + sysErr2)) {
    489495                numRejected++;
    490496                match->mask->data.PS_TYPE_VECTOR_MASK_DATA[j] = 0xFF;
    491             }
     497              }
     498            }
    492499        }
    493500    }
     
    528535    float lastChi2 = INFINITY;          // chi^2 on last iteration
    529536    float fracRej = INFINITY;        // Fraction of measurements rejected
     537
     538    // in the first passes, the transparencies are not well deteremined: use high systematic error and the rejection thresholds
     539    for (int i = 0; i < 5; i++) {
     540
     541        // Identify photometric nights
     542        int numPhoto = sourceMatchRelphotPhotometric(photo, trans, transIter, transClip, photoLevel); // Number of photometric images
     543        if (numPhoto < 0) {
     544            psError(PS_ERR_UNKNOWN, false, "Unable to perform photometric determination");
     545            psFree(trans);
     546            psFree(photo);
     547            psFree(stars);
     548            return NULL;
     549        }
     550        psTrace("psModules.objects", 3, "Pass 1: Determined %d/%d are photometric", numPhoto, numImages);
     551
     552        // XXX use 20 sigma rejection and 0.1 mag systematic error (move these to the recipe)
     553        fracRej = sourceMatchRelphotReject(trans, stars, matches, zp, photo, 20.0, PS_SQR(0.1));
     554        psTrace("psModules.objects", 3, "Pass 1: %f%% of measurements rejected", fracRej * 100);
     555
     556        // XXX use 0.05 mag systematic error (move these to the recipe)
     557        chi2 = sourceMatchRelphotIterate(trans, stars, matches, zp, photo, PS_SQR(0.1)); // chi^2 for solution
     558        psTrace("psModules.objects", 1, "Pass 1: iter = %d: chi^2 = %f rejected = %f\n", i, chi2, fracRej);
     559    }
     560
    530561    for (int i = 0; i < maxIter && (fabsf(lastChi2 - chi2) > tol * chi2 || fracRej > rejLimit); i++) {
    531562        lastChi2 = chi2;
Note: See TracChangeset for help on using the changeset viewer.