IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 3, 2015, 1:53:13 PM (11 years ago)
Author:
bills
Message:

If background modeling fails with PSPHOT_ERR_DATA add integer PSPHOT_QUALITY to readout->analysis.
psphotFullForce will use this to set quality value for the result. Other programs should be unaffected
except that error code will not be changed from PSPHOT_ERR_DATA previously the error code would
be PSPHOT_ERR_CONFIG

File:
1 edited

Legend:

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

    r35769 r37940  
    277277        psFree(binning);
    278278        psFree(rng);
     279        psFree(dQ);
    279280        return false;
    280281    }
     
    386387
    387388    if (!psphotModelBackgroundReadout(model->image, modelStdev->image, model->analysis, readout, binning, config, false)) {
    388         psError(PS_ERR_UNKNOWN, false, "Unable to generate background model");
     389        int lastError = psErrorCodeLast();
     390        if (lastError == PSPHOT_ERR_DATA) {
     391            // depending on context this value may or may not be used
     392            psMetadataAddS32 (readout->analysis, PS_LIST_TAIL, "PSPHOT_QUALITY", PS_META_REPLACE, "quality error due to poor data", lastError);
     393        }
     394        psError(lastError, false, "Unable to generate background model");
    389395        return false;
    390396    }
     
    404410    for (int i = 0; i < num; i++) {
    405411        if (!psphotModelBackgroundReadoutFileIndex(config, view, filerule, i)) {
    406             psError (PSPHOT_ERR_CONFIG, false, "failed to model background for %s entry %d", filerule, i);
     412            int lastError = psErrorCodeLast();
     413            psError (lastError ? lastError : PSPHOT_ERR_CONFIG, false, "failed to model background for %s entry %d", filerule, i);
    407414            return false;
    408415        }
Note: See TracChangeset for help on using the changeset viewer.