IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 21080


Ignore:
Timestamp:
Jan 2, 2009, 3:04:51 PM (18 years ago)
Author:
eugene
Message:

gracefully handle failures with ApResid Trend

File:
1 edited

Legend:

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

    r20864 r21080  
    137137    if (Npsf < APTREND_NSTAR_MIN) {
    138138        psWarning("Only %d valid aperture residual sources (need %d), giving up", Npsf, APTREND_NSTAR_MIN);
    139         // save nan values since these were not calculated
    140         psMetadataAdd (recipe, PS_LIST_TAIL, "SKYBIAS",  PS_DATA_F32 | PS_META_REPLACE, "aperture sky bias",   NAN);
    141         psMetadataAdd (recipe, PS_LIST_TAIL, "SKYSAT",   PS_DATA_F32 | PS_META_REPLACE, "aperture-determined saturation",   NAN);
    142         psMetadataAdd (recipe, PS_LIST_TAIL, "APMIFIT",  PS_DATA_F32 | PS_META_REPLACE, "aperture residual",   NAN);
    143         psMetadataAdd (recipe, PS_LIST_TAIL, "DAPMIFIT", PS_DATA_F32 | PS_META_REPLACE, "ap residual scatter", NAN);
    144         psMetadataAdd (recipe, PS_LIST_TAIL, "APLOSS",   PS_DATA_F32 | PS_META_REPLACE, "aperture loss (mag)", NAN);
    145         psMetadataAdd (recipe, PS_LIST_TAIL, "NAPMIFIT", PS_DATA_S32 | PS_META_REPLACE, "number of apresid stars", 0);
    146 
    147         psFree (mag);
    148         psFree (mask);
    149         psFree (xPos);
    150         psFree (yPos);
    151         psFree (apResid);
    152         psFree (dMag);
    153         return false;
     139        goto escape;
    154140    }
    155141
     
    179165    }
    180166    if (entryMin == -1) {
    181         psAbort ("failed on ApResid Trend");
     167        psWarning("Failed to find a valid aperture residual value");
     168        goto escape;
    182169    }
    183170
     
    236223
    237224    return true;
     225
     226escape:
     227    // save nan values since these were not calculated
     228    psMetadataAdd (recipe, PS_LIST_TAIL, "SKYBIAS",  PS_DATA_F32 | PS_META_REPLACE, "aperture sky bias",   NAN);
     229    psMetadataAdd (recipe, PS_LIST_TAIL, "SKYSAT",   PS_DATA_F32 | PS_META_REPLACE, "aperture-determined saturation",   NAN);
     230    psMetadataAdd (recipe, PS_LIST_TAIL, "APMIFIT",  PS_DATA_F32 | PS_META_REPLACE, "aperture residual",   NAN);
     231    psMetadataAdd (recipe, PS_LIST_TAIL, "DAPMIFIT", PS_DATA_F32 | PS_META_REPLACE, "ap residual scatter", NAN);
     232    psMetadataAdd (recipe, PS_LIST_TAIL, "APLOSS",   PS_DATA_F32 | PS_META_REPLACE, "aperture loss (mag)", NAN);
     233    psMetadataAdd (recipe, PS_LIST_TAIL, "NAPMIFIT", PS_DATA_S32 | PS_META_REPLACE, "number of apresid stars", 0);
     234
     235    psFree (mag);
     236    psFree (mask);
     237    psFree (xPos);
     238    psFree (yPos);
     239    psFree (apResid);
     240    psFree (dMag);
     241    return false;
    238242}
    239243
Note: See TracChangeset for help on using the changeset viewer.