IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 17090


Ignore:
Timestamp:
Mar 24, 2008, 2:44:24 PM (18 years ago)
Author:
Paul Price
Message:

Adding code from ppMergeCheckInputs to cull chips and cells that don't have data.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/pap_branch_080320/ppMerge/src/ppMergeCamera.c

    r17083 r17090  
    175175    }
    176176
     177    // Cull chips and cells that don't have data
     178    // Otherwise the abundance of metadata in the concepts (esp. for GPC) can overload the memory
     179    for (int i = 0; i < numFiles; i++) {
     180        pmFPAfile *input = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i); // File of interest
     181        pmFPA *fpa = input->fpa;        // FPA of interest
     182        psArray *chips = fpa->chips; // Array of chips in output
     183        for (int i = 0; i < chips->n; i++) {
     184            pmChip *chip = chips->data[i]; // Chip of interest
     185            psArray *cells = chip->cells; // Array of cells
     186            int culled = 0;             // Number of culled cells
     187            for (int j = 0; j < cells->n; j++) {
     188                pmCell *cell = cells->data[j];
     189                pmHDU *hdu = pmHDUGetLowest(fpa, chip, cell); // HDU for cell
     190                if (!hdu || hdu->blankPHU) {
     191                    psFree(cell->concepts);
     192                    cell->concepts = NULL;
     193                    culled++;
     194                }
     195            }
     196            if (culled == cells->n) {
     197                psFree(chip->concepts);
     198                chip->concepts = NULL;
     199            }
     200        }
     201    }
     202
    177203    // Count the cells
    178204    {
Note: See TracChangeset for help on using the changeset viewer.