IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13193


Ignore:
Timestamp:
May 3, 2007, 10:04:52 AM (19 years ago)
Author:
magnier
Message:

added test for output data existence before opening output data file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmFPAfileIO.c

    r13034 r13193  
    1616#include "pmFPAMaskWeight.h"
    1717#include "pmFPAview.h"
     18#include "pmFPAFlags.h"
    1819#include "pmFPAfile.h"
    1920#include "pmFPACopy.h"
     
    320321    }
    321322
     323    // do we have data to write at this level?
     324    if (!pmFPAviewCheckDataStatus (file->fpa, view)) {
     325        psTrace("psModules.camera", 6, "skip write for %s, no data for this entry", file->name);
     326        return true;
     327    }
     328
     329    // note that for CMF and PSF, the test above is not sufficient to determine if there
     330    // is actually any data to write out.  this is because these types of output files
     331    // have their data stored on the readout->analysis metadata structure of another
     332    // (existing) fpa
     333    if (file->type == PM_FPA_FILE_PSF) {
     334      if (!pmFPAviewCheckDataStatusForPSFmodel (view, file)) {
     335        psTrace("psModules.camera", 6, "skip write for %s, no data for this entry", file->name);
     336        return true;
     337      }
     338    }
     339    if (file->type == PM_FPA_FILE_CMF) {
     340      if (!pmFPAviewCheckDataStatusForSources (view, file)) {
     341        psTrace("psModules.camera", 6, "skip write for %s, no data for this entry", file->name);
     342        return true;
     343      }
     344    }
     345
    322346    // open the file if not yet opened
    323347    // XXX do we need to test mosaicLevel?
     
    637661      case PM_FPA_FILE_HEADER:
    638662      case PM_FPA_FILE_FRINGE:
     663        // XXX note that for CMF and PSF, we do not know yet if there is actually any data to
     664        // write out.  this is because these types of output files have their data stored on the
     665        // readout->analysis metadata structure of another (existing) fpa
    639666      case PM_FPA_FILE_CMF:
    640667      case PM_FPA_FILE_PSF:
Note: See TracChangeset for help on using the changeset viewer.