IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 22, 2006, 10:03:50 AM (20 years ago)
Author:
magnier
Message:

added pmReadoutFreeData, freeing bias sections

File:
1 edited

Legend:

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

    r7604 r7630  
    1212* XXX: Should we implement non-linear cell->chip transforms?
    1313*
    14 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2006-06-21 03:21:16 $
     14*  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2006-06-22 20:03:50 $
    1616*
    1717*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    177177}
    178178
     179void pmReadoutFreeData (pmReadout *readout)
     180{
     181    psFree(readout->image);
     182    psFree(readout->mask);
     183    psFree(readout->weight);
     184    psFree(readout->bias);
     185
     186    readout->image = NULL;
     187    readout->weight = NULL;
     188    readout->mask = NULL;
     189    readout->bias = NULL;
     190}
     191
    179192void pmCellFreeData(pmCell *cell)
    180193{
    181194    PS_ASSERT_PTR_NON_NULL(cell,);
    182195
    183     pmCellFreeReadouts(cell);
     196    for (int i = 0; i < cell->readouts->n; i++) {
     197        pmReadoutFreeData(cell->readouts->data[i]);
     198    }
    184199    if (cell->hdu) {
    185200        psFree(cell->hdu->images);
     201        psFree(cell->hdu->weights);
     202        psFree(cell->hdu->masks);
     203        // psFree(cell->hdu->header);
     204
    186205        cell->hdu->images = NULL;
     206        cell->hdu->weights = NULL;
     207        cell->hdu->masks = NULL;
     208        // cell->hdu->header = NULL;
    187209    }
    188210}
     
    197219    if (chip->hdu) {
    198220        psFree(chip->hdu->images);
     221        psFree(chip->hdu->weights);
     222        psFree(chip->hdu->masks);
     223        // psFree(chip->hdu->header);
     224
    199225        chip->hdu->images = NULL;
     226        chip->hdu->weights = NULL;
     227        chip->hdu->masks = NULL;
     228        // chip->hdu->header = NULL;
    200229    }
    201230}
     
    210239    if (fpa->hdu) {
    211240        psFree(fpa->hdu->images);
     241        psFree(fpa->hdu->weights);
     242        psFree(fpa->hdu->masks);
     243        // psFree(fpa->hdu->header);
     244
    212245        fpa->hdu->images = NULL;
     246        fpa->hdu->weights = NULL;
     247        fpa->hdu->masks = NULL;
     248        // fpa->hdu->header = NULL;
    213249    }
    214250}
Note: See TracChangeset for help on using the changeset viewer.