IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 21, 2006, 12:29:48 AM (20 years ago)
Author:
Paul Price
Message:

Working, but leaks memory something chronic

File:
1 edited

Legend:

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

    r6114 r6125  
    11# include "ppImage.h"
     2
     3psMemId ppMemPrint(const psMemBlock *ptr)
     4{
     5    psLogMsg(__func__, PS_LOG_INFO,
     6             "Memory block %d (%ld):\n"
     7             "\tFile %s, line %d, size %d\n"
     8             "\tPosts: %lx %lx %lx\n",
     9             ptr->id, ptr->refCounter, ptr->file, ptr->lineno, ptr->userMemorySize, ptr->startblock,
     10             ptr->endblock, *(void**)((int8_t *)(ptr + 1) + ptr->userMemorySize));
     11    return 0;
     12}
    213
    314// Read the entire FPA
     
    5162    psArray *chips = data->input->fpa->chips; // Component chips
    5263    for (int i = 0; i < chips->n; i++) {
     64
     65        if (i > 6) {
     66            continue;
     67        }
     68
    5369        if (processChip >= 0 && i != processChip) {
    5470            continue;
     
    100116        psLogMsg(__func__, PS_LOG_INFO, "%d cells mosaicked.\n", numMosaicked);
    101117
     118        // XXX EAM: Photometry goes here!
     119
     120        // A kludge to get the write to behave wrt the concepts
     121        const psMetadata *camera = data->input->fpa->camera;
     122        data->input->fpa->camera = NULL;
     123        pmFPAWrite(data->output, data->input->fpa, config->database);
     124        data->input->fpa->camera = camera;
     125
     126        // Now I can blow away the mosaic so I can then read more.
     127        psFree(chips->data[i]);
     128        ppMemPrint((psMemBlock*)chips->data[i]-1);
    102129    }
     130
     131#if 0
     132    // Write out the mosaicked chip, just to see; this wouldn't normally happen
     133    psFits *mosaicFile = psFitsOpen("mosaic.fits", "w");
     134    for (int i = 0; i < chips->n; i++) {
     135        pmChip *chip = chips->data[i];
     136        if (! chip || ! chip->exists || ! chip->process) {
     137            continue;
     138        }
     139#if 0
     140        psArray *cells = chip->cells;
     141        pmCell *cell = cells->data[0];
     142        psArray *readouts = cell->readouts;
     143        pmReadout *readout = readouts->data[0];
     144        psImage *image = readout->image;
     145#else
     146        psImage *image = chip->hdu->images->data[0];
     147#endif
     148        psFitsWriteImage(mosaicFile, NULL, image, 0);
     149
     150    }
     151#endif
    103152
    104153    // Free the detrend FPA and chips
     
    108157    psFree(data->flat);
    109158
     159    psFitsClose(data->output);
    110160
    111161    return true;
Note: See TracChangeset for help on using the changeset viewer.