IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13831


Ignore:
Timestamp:
Jun 14, 2007, 8:57:32 AM (19 years ago)
Author:
eugene
Message:

move DropInternal calls before possible returns

File:
1 edited

Legend:

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

    r13529 r13831  
    55// case, or if the fail on the stats measurement, do we return false
    66bool psphotReadoutCleanup (pmConfig *config, pmReadout *readout, psMetadata *recipe, pmPSF *psf, psArray *sources) {
     7
     8    // remove internal pmFPAfiles, if created
     9    bool status = true;
     10    status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL");
     11    status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL.STDEV");
     12    status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKGND");
     13    if (!status) {
     14        psError(PSPHOT_ERR_PROG, false, "trouble dropping internal files");
     15        return false;
     16    }
    717
    818    if (psErrorCodeLast() == PSPHOT_ERR_DATA) {
     
    1424    // use the psf-model to measure FWHM stats
    1525    if (psf) {
    16         // don't call psphotPSFstats unless we have a valid pdf
    17         // if it fails, there is probably a programming error
    1826        if (!psphotPSFstats (readout, recipe, psf)) {
    1927            psError(PSPHOT_ERR_PROG, false, "Failed to measure PSF shape parameters");
     
    2129        }
    2230    }
     31    // otherwise, use the source moments to measure FWHM stats
    2332    if (!psf && sources) {
    2433        if (!psphotMomentsStats (readout, recipe, sources)) {
     
    4554    }
    4655
    47     // remove internal pmFPAfiles, if created
    48     pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL");
    49     pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL.STDEV");
    50     pmFPAfileDropInternal (config->files, "PSPHOT.BACKGND");
    51 
    5256    if (psErrorCodeLast() != PS_ERR_NONE) {
    5357        psErrorStackPrint(stderr, "unexpected remaining errors");
Note: See TracChangeset for help on using the changeset viewer.