IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 15078


Ignore:
Timestamp:
Sep 28, 2007, 11:04:05 AM (19 years ago)
Author:
eugene
Message:

limit order of aperture correction

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotApResid.c

    r15042 r15078  
    2929
    3030    // XXX is this still needed?  the pmTrend2D stuff should be auto-adjusting...
    31     int NSTAR_APERTURE_CORRECTION_MIN = psMetadataLookupS32(&status, recipe, "NSTAR_APERTURE_CORRECTION_MIN");
    32     if (!status) {
    33         NSTAR_APERTURE_CORRECTION_MIN = 5;
     31    int APTREND_NSTAR_MIN = psMetadataLookupS32(&status, recipe, "APTREND.NSTAR.MIN");
     32    assert (status);
     33
     34    // maximum order for aperture correction
     35    int APTREND_ORDER_MAX = psMetadataLookupS32(&status, recipe, "APTREND.ORDER.MAX");
     36    assert (status);
     37
     38    if (APTREND_ORDER_MAX < 1) {
     39        psError(PSPHOT_ERR_CONFIG, true, "APTREND.ORDER.MAX must be 1 or more");
     40        return false;
    3441    }
    3542
     
    116123
    117124    // XXX choose a better value here?
    118     if (Npsf < NSTAR_APERTURE_CORRECTION_MIN) {
     125    if (Npsf < APTREND_NSTAR_MIN) {
    119126        psError(PSPHOT_ERR_APERTURE, true, "Only %d valid aperture residual sources (need %d), giving up",
    120                 Npsf, NSTAR_APERTURE_CORRECTION_MIN);
     127                Npsf, APTREND_NSTAR_MIN);
    121128        return false;
    122129    }
     
    132139    int entryMin = -1;
    133140
    134     // *** iterate over spatial scale until error Floor increases
    135     // *** fit out the dap vs mag trend?
    136     // *** stop if Npsf / (Nx * Ny) < 3
    137     for (int i = 1; i < 10; i++) {
     141    // Fit out the dap vs mag trend, iterate over spatial scale until error Floor increases.
     142    // Stop if Npsf / (Nx * Ny) < 3
     143    for (int i = 1; i <= APTREND_ORDER_MAX; i++) {
    138144
    139145        if (!psphotApResidTrend (readout, psf, Npsf, i, &errorScale, &errorFloor, mask, xPos, yPos, apResid, dMag)) {
Note: See TracChangeset for help on using the changeset viewer.