IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13670


Ignore:
Timestamp:
Jun 5, 2007, 4:23:33 PM (19 years ago)
Author:
magnier
Message:

need to identify the correct view for each level of the iteration

File:
1 edited

Legend:

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

    r13527 r13670  
    33 *  @author EAM, IfA
    44 *
    5  *  @version $Revision: 1.41 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2007-05-26 02:52:53 $
     5 *  @version $Revision: 1.42 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2007-06-06 02:23:33 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    161161bool pmFPAWriteObjects (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
    162162{
     163    pmFPAview *thisView = pmFPAviewAlloc (view->nRows);
     164    *thisView = *view;
    163165
    164166    for (int i = 0; i < fpa->chips->n; i++) {
    165 
    166167        pmChip *chip = fpa->chips->data[i];
    167         if (!pmChipWriteObjects (chip, view, file, config)) {
     168        thisView->chip = i;
     169        if (!pmChipWriteObjects (chip, thisView, file, config)) {
    168170            psError(PS_ERR_IO, false, "Failed to write %dth chip", i);
    169             return false;
    170         }
    171     }
     171            psFree (thisView);
     172            return false;
     173        }
     174    }
     175    psFree (thisView);
    172176    return true;
    173177}
     
    176180bool pmChipWriteObjects (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
    177181{
     182    pmFPAview *thisView = pmFPAviewAlloc (view->nRows);
     183    *thisView = *view;
    178184
    179185    for (int i = 0; i < chip->cells->n; i++) {
    180186
    181187        pmCell *cell = chip->cells->data[i];
    182         if (!pmCellWriteObjects (cell, view, file, config)) {
     188        thisView->cell = i;
     189        if (!pmCellWriteObjects (cell, thisView, file, config)) {
    183190            psError(PS_ERR_IO, false, "Failed to write %dth cell", i);
    184             return false;
    185         }
    186     }
     191            psFree (thisView);
     192            return false;
     193        }
     194    }
     195    psFree (thisView);
    187196    return true;
    188197}
     
    191200bool pmCellWriteObjects (pmCell *cell, const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
    192201{
     202    pmFPAview *thisView = pmFPAviewAlloc (view->nRows);
     203    *thisView = *view;
    193204
    194205    for (int i = 0; i < cell->readouts->n; i++) {
    195206
    196207        pmReadout *readout = cell->readouts->data[i];
    197         if (!pmReadoutWriteObjects (readout, view, file, config)) {
     208        thisView->readout = i;
     209        if (!pmReadoutWriteObjects (readout, thisView, file, config)) {
    198210            psError(PS_ERR_IO, false, "Failed to write %dth readout", i);
    199             return false;
    200         }
    201     }
     211            psFree (thisView);
     212            return false;
     213        }
     214    }
     215    psFree (thisView);
    202216    return true;
    203217}
     
    464478bool pmFPAReadObjects (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
    465479{
     480    pmFPAview *thisView = pmFPAviewAlloc (view->nRows);
     481    *thisView = *view;
     482
    466483    for (int i = 0; i < fpa->chips->n; i++) {
    467484        pmChip *chip = fpa->chips->data[i];
    468         pmChipReadObjects (chip, view, file, config);
    469     }
     485        thisView->chip = i;
     486        pmChipReadObjects (chip, thisView, file, config);
     487    }
     488    psFree (thisView);
    470489    return true;
    471490}
     
    474493bool pmChipReadObjects (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
    475494{
     495    pmFPAview *thisView = pmFPAviewAlloc (view->nRows);
     496    *thisView = *view;
     497
    476498    chip->data_exists = false;
    477499    for (int i = 0; i < chip->cells->n; i++) {
    478500        pmCell *cell = chip->cells->data[i];
    479         pmCellReadObjects (cell, view, file, config);
     501        thisView->cell = i;
     502        pmCellReadObjects (cell, thisView, file, config);
    480503        if (!cell->data_exists) continue;
    481504        chip->data_exists = true;
    482505    }
     506    psFree (thisView);
    483507    return true;
    484508}
     
    487511bool pmCellReadObjects (pmCell *cell, const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
    488512{
     513    pmFPAview *thisView = pmFPAviewAlloc (view->nRows);
     514    *thisView = *view;
     515
    489516    // multiple readout mode is not yet defined for CMP or CMF files
    490517    // if they have not been allocated, allocate a single readout
     
    497524    for (int i = 0; i < cell->readouts->n; i++) {
    498525        pmReadout *readout = cell->readouts->data[i];
    499         pmReadoutReadObjects (readout, view, file, config);
     526        thisView->readout = i;
     527        pmReadoutReadObjects (readout, thisView, file, config);
    500528        if (!readout->data_exists) {
    501529            continue;
     
    510538        cell->data_exists = true;
    511539    }
     540    psFree (thisView);
    512541    return true;
    513542}
Note: See TracChangeset for help on using the changeset viewer.