IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 8, 2006, 4:37:59 PM (20 years ago)
Author:
Paul Price
Message:

Working version with no memory leaks (on MegaCam splice images)!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppImage/src/ppImageLoop.c

    r6260 r6396  
    77#include "ppImageDetrend.h"
    88#include "ppImage.h"
     9#include "ppMem.h"
    910
    1011#define MEM_LEAKS 1
     
    101102
    102103            // Need to free detrend cells here so we have enough memory to do other stuff
    103 #ifndef MEM_LEAKS
    104104            psFree(detrend.bias);
    105105            psFree(detrend.dark);
    106106            psFree(detrend.mask);
    107107            psFree(detrend.flat);
    108 #endif
    109108        }
    110109
     
    114113        // XXX EAM: Photometry goes here!
    115114
    116         // A kludge to get the write to behave wrt the concepts --- we've changed the camera format, so
     115        // XXX A kludge to get the write to behave w.r.t. the concepts --- we've changed the camera format, so
    117116        // the concepts don't know what on earth to do.
    118117        const psMetadata *camera = data->input->fpa->camera;
     
    122121
    123122        // Now I can blow away the mosaic so I can then read more.
    124 #ifndef MEM_LEAKS
    125         pmChipFreeCells(inputChip);
    126 #endif
     123        psFree(inputChip);
    127124    }
    128 
    129 #if 0
    130     // Write out the mosaicked chip, just to see; this wouldn't normally happen
    131     psFits *mosaicFile = psFitsOpen("mosaic.fits", "w");
    132     for (int i = 0; i < chips->n; i++) {
    133         pmChip *chip = chips->data[i];
    134         if (! chip || ! chip->exists || ! chip->process) {
    135             continue;
    136         }
    137 #if 0
    138         psArray *cells = chip->cells;
    139         pmCell *cell = cells->data[0];
    140         psArray *readouts = cell->readouts;
    141         pmReadout *readout = readouts->data[0];
    142         psImage *image = readout->image;
    143 #else
    144         psImage *image = chip->hdu->images->data[0];
    145 #endif
    146         psFitsWriteImage(mosaicFile, NULL, image, 0);
    147 
    148     }
    149 #endif
    150 
    151     // Free the detrend FPA and chips
    152 #ifndef MEM_LEAKS
    153     psFree(data->bias);
    154     psFree(data->dark);
    155     psFree(data->mask);
    156     psFree(data->flat);
    157 #endif
    158 
    159     psFitsClose(data->output);
    160125
    161126    return true;
    162127}
    163 
    164 /* if we allow per-readout loads, we need to load detrend images here */
Note: See TracChangeset for help on using the changeset viewer.