IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 10, 2010, 2:45:18 PM (16 years ago)
Author:
Paul Price
Message:

Working!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppBackground/src/ppBackgroundLoop.c

    r28296 r28300  
    8686                    readout->image = psImageAlloc(numCols, numRows, PS_TYPE_F32);
    8787                    psImageInit(readout->image, 0.0);
     88                    readout->mask = psImageAlloc(numCols, numRows, PS_TYPE_IMAGE_MASK);
     89                    psImageInit(readout->mask, 0);
    8890
    8991                    if (!pmPatternRowApply(readout, maskBad) || !pmPatternCellApply(readout, maskBad)) {
     
    116118            }
    117119
    118             pmChip *mosaic = pmFPAviewThisChip(view, patternMosaic); // Chip for mosaicked pattern
    119             if (!mosaic->hdu && !mosaic->parent->hdu) {
    120                 pmFPAAddSourceFromView(patternMosaic, view, file->format);
     120            if (data->patternName) {
     121                pmChip *patternChip = pmFPAviewThisChip(view, patternFile->fpa); // Chip for pattern
     122                pmChip *mosaic = pmFPAviewThisChip(view, patternMosaic); // Chip for mosaicked pattern
     123                if (!mosaic->hdu && !mosaic->parent->hdu) {
     124                    pmFPAAddSourceFromView(patternMosaic, view, file->format);
     125                }
     126                if (!pmChipMosaic(mosaic, patternChip, true, maskBad)) {
     127                    psError(psErrorCodeLast(), false, "Unable to mosaic pattern correction");
     128                    return false;
     129                }
     130                pmFPAfileActivate(config->files, true, NULL);
     131            //            pmFPAfileActivate(config->files, false, "PPBACKGROUND.PATTERN");
    121132            }
    122             if (!pmChipMosaic(mosaic, chip, true, maskBad)) {
    123                 psError(psErrorCodeLast(), false, "Unable to mosaic pattern correction");
    124                 return false;
    125             }
    126             pmFPAfileActivate(config->files, true, NULL);
    127             //            pmFPAfileActivate(config->files, false, "PPBACKGROUND.PATTERN");
    128133        }
    129134
    130         pmChip *outChip = pmFPAfileThisChip(config->files, view, "PPBACKGROUND.OUTPUT"); // Chip for output
    131135        pmChip *patternChip = patternFile ? pmFPAviewThisChip(view, patternMosaic) : NULL; // Chip with pattern
    132136        pmChip *bgChip = bgFile ? pmFPAviewThisChip(view, bgFile->fpa) : NULL; // Chip with background model
    133         if (!ppBackgroundRestore(outChip, chip, bgChip, patternChip, view, config)) {
     137        if (!ppBackgroundRestore(chip, bgChip, patternChip, view, config)) {
    134138            psError(psErrorCodeLast(), false, "Unable to replace background");
    135139            return false;
Note: See TracChangeset for help on using the changeset viewer.