IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 29, 2008, 2:55:44 PM (18 years ago)
Author:
eugene
Message:

add smoothing of suspect pixels; chip and cell options; skip unused chips and cells as needed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppMerge/src/ppMergeCamera.c

    r17929 r18365  
    3030        return false;
    3131    }
     32
     33    // Chip selection: turn on only the chips specified.
     34    bool status;
     35    char *chipLine = psMetadataLookupStr(&status, config->arguments, "CHIP_SELECTIONS");
     36    psArray *chips = psStringSplitArray (chipLine, ",", false);
     37    if (chips->n > 0) {
     38        pmFPASelectChip (fpa, -1, true); // deselect all chips
     39        for (int i = 0; i < chips->n; i++) {
     40            int chipNum = atoi(chips->data[i]);
     41            if (! pmFPASelectChip(fpa, chipNum, false)) {
     42                psError(PS_ERR_IO, false, "Chip number %d doesn't exist in camera.\n", chipNum);
     43                psFree (chips);
     44                return false;
     45            }
     46        }
     47    }
     48    psFree (chips);
     49
     50    // Cell selection: turn on only the cells specified.  Note that this affects the same cell
     51    // for all chips
     52    char *cellLine = psMetadataLookupStr(&status, config->arguments, "CELL_SELECTIONS");
     53    psArray *cells = psStringSplitArray (cellLine, ",", false);
     54    if (cells->n > 0) {
     55        for (int i = 0; i < fpa->chips->n; i++) {
     56            pmChip *chip = fpa->chips->data[i];
     57            pmChipSelectCell (chip, -1, true); // deselect all cells
     58            for (int j = 0; j < cells->n; j++) {
     59                int cellNum = atoi(cells->data[j]);
     60                if (! pmChipSelectCell(chip, cellNum, false)) {
     61                    psError(PS_ERR_IO, false, "Cell number %d doesn't exist in camera.\n", cellNum);
     62                    psFree (cells);
     63                    return false;
     64                }
     65            }
     66        }
     67    }
     68    psFree (cells);
    3269
    3370    pmFPAfile *output = pmFPAfileDefineOutput(config, fpa, name);
     
    229266                pmHDU *hdu = pmHDUGetLowest(fpa, chip, cell); // HDU for cell
    230267                if (!hdu || hdu->blankPHU) {
    231                     psFree(cell->concepts);
    232                     cell->concepts = NULL;
    233268                    cell->data_exists = false;
    234269                    cell->file_exists = false;
    235270                    culled++;
     271                    if (cell->concepts) {
     272                        psFree(cell->concepts);
     273                        cell->concepts = NULL;
     274                    }
    236275                }
    237276            }
    238277            if (culled == cells->n) {
    239                 psFree(chip->concepts);
    240                 chip->concepts = NULL;
    241278                chip->data_exists = false;
    242279                chip->file_exists = false;
     280                if (chip->concepts) {
     281                    psFree(chip->concepts);
     282                    chip->concepts = NULL;
     283                }
    243284            }
    244285        }
Note: See TracChangeset for help on using the changeset viewer.