IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 30, 2007, 5:01:34 PM (19 years ago)
Author:
magnier
Message:

track data_exists state for readout,cell,chip

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmSourceIO.c

    r12696 r12703  
    33 *  @author EAM, IfA
    44 *
    5  *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2007-03-30 21:12:56 $
     5 *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2007-03-31 03:01:34 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    445445bool pmChipReadObjects (pmChip *chip, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
    446446{
     447    chip->data_exists = false;
    447448    for (int i = 0; i < chip->cells->n; i++) {
    448449        pmCell *cell = chip->cells->data[i];
    449450        pmCellReadObjects (cell, view, file, config);
     451        if (!cell->data_exists) continue;
     452        chip->data_exists = true;
    450453    }
    451454    return true;
     
    462465    }
    463466
     467    cell->data_exists = false;
    464468    for (int i = 0; i < cell->readouts->n; i++) {
    465469        pmReadout *readout = cell->readouts->data[i];
    466470        pmReadoutReadObjects (readout, view, file, config);
     471        if (!readout->data_exists) {
     472            continue;
     473        }
    467474
    468475        // load in the concept information for this cell
     
    472479            psWarning("Difficulty reading concepts for cell; attempting to proceed.");
    473480        }
    474 
    475481        cell->data_exists = true;
    476482    }
     
    560566        // advance to the IMAGE HEADER extension
    561567        if (hdu->header == NULL) {
    562             psFitsMoveExtName (file->fits, headname);
     568            // if the IMAGE header does not exist, we have no data for this view
     569            if (!psFitsMoveExtName (file->fits, headname)) {
     570                readout->data_exists = false;
     571                psFree (headname);
     572                psFree (dataname);
     573                return true;
     574            }
    563575            hdu->header = psFitsReadHeader (NULL, file->fits);
    564576        }
     
    574586       
    575587        // advance to the table data extension
     588        // since we have read the IMAGE header, the TABLE header should exist
    576589        if (!psFitsMoveExtName (file->fits, dataname)) {
    577590            psAbort("cannot find data extension %s in %s", dataname, file->filename);
Note: See TracChangeset for help on using the changeset viewer.