IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 28263


Ignore:
Timestamp:
Jun 8, 2010, 4:00:13 PM (16 years ago)
Author:
Paul Price
Message:

Hack darks so that they don't look like video cells for pmChipMosaic.

File:
1 edited

Legend:

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

    r27989 r28263  
    2828    }
    2929
     30    // If the input is a dark (normalising and mosaicking) then it looks like a video cell and will be ignored
     31    // by pmChipMosaic.  We therefore hack the structure so it doesn't look like a video cell.
     32    psVector *darkNumbers = NULL;       // Number of dark readouts for each cell
     33    psVectorInit(darkNumbers, 0);
     34    if (psMetadataLookupBool(&status, config->arguments, "INPUT_IS_DARK")) {
     35        darkNumbers = psVectorAlloc(inChip->cells->n, PS_TYPE_S32);
     36        for (int i = 0; i < inChip->cells->n; i++) {
     37            pmCell *cell = inChip->cells->data[i];
     38            if (!cell) {
     39                continue;
     40            }
     41            darkNumbers->data.S32[i] = cell->readouts->n;
     42            cell->readouts->n = 1;
     43        }
     44    }
     45
    3046    psTrace("pmChipMosaic", 5, "mosaic chip %s to %s (xbin,ybin: %d,%d to %d,%d)\n",
    3147            in->name, out->name, in->xBin, in->yBin, out->xBin, out->yBin);
     
    3450    // image products pure trimmed images, but also increases the memory footprint.
    3551    status = pmChipMosaic(outChip, inChip, true, options->blankMask);
     52
     53    // Restore dark structure
     54    if (darkNumbers) {
     55        for (int i = 0; i < inChip->cells->n; i++) {
     56            pmCell *cell = inChip->cells->data[i];
     57            if (!cell) {
     58                continue;
     59            }
     60            cell->readouts->n = darkNumbers->data.S32[i];
     61        }
     62        psFree(darkNumbers);
     63    }
     64
    3665    return status;
    3766}
Note: See TracChangeset for help on using the changeset viewer.