IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 10, 2010, 6:28:51 PM (16 years ago)
Author:
watersc1
Message:

Skycell Summary and stack Association stuff should be finished. I'll merge and do final tests on monday.

Location:
branches/czw_branch/20100519
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20100519

  • branches/czw_branch/20100519/ppImage/src/ppImageMosaic.c

    r27989 r28304  
    99{
    1010    bool status;                        // Status of MD lookup
    11 
     11        printf("PPIM: %x %s\n",psErrorCodeLast(),psErrorCodeString(psErrorCodeLast()));
    1212    pmFPAfile *in = psMetadataLookupPtr(&status, config->files, inFile); // Input file
    1313    if (!status) {
     
    1515        exit(EXIT_FAILURE);
    1616    }
    17 
     17        printf("PPIM: %x %s\n",psErrorCodeLast(),psErrorCodeString(psErrorCodeLast()));
    1818    pmFPAfile *out = psMetadataLookupPtr(&status, config->files, outFile); // Output file
    1919    if (!status) {
     
    2121        exit(EXIT_FAILURE);
    2222    }
    23 
     23        printf("PPIM: %x %s\n",psErrorCodeLast(),psErrorCodeString(psErrorCodeLast()));
    2424    pmChip *outChip = pmFPAviewThisChip(view, out->fpa);
    2525    pmChip *inChip = pmFPAviewThisChip(view, in->fpa);
     
    2727        pmFPAAddSourceFromView(out->fpa, view, out->format);
    2828    }
    29 
     29        printf("PPIM: %x %s\n",psErrorCodeLast(),psErrorCodeString(psErrorCodeLast()));
     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    printf("PPIM: %x %s\n",psErrorCodeLast(),psErrorCodeString(psErrorCodeLast()));
     35    if (psMetadataLookupBool(&status, config->arguments, "INPUT_IS_DARK")) {
     36        darkNumbers = psVectorAlloc(inChip->cells->n, PS_TYPE_S32);
     37        psVectorInit(darkNumbers, 0);
     38        for (int i = 0; i < inChip->cells->n; i++) {
     39            pmCell *cell = inChip->cells->data[i];
     40            if (!cell) {
     41                continue;
     42            }
     43            darkNumbers->data.S32[i] = cell->readouts->n;
     44            cell->readouts->n = 1;
     45        }
     46    }
     47        printf("PPMI: %x %s\n",psErrorCodeLast(),psErrorCodeString(psErrorCodeLast()));
    3048    psTrace("pmChipMosaic", 5, "mosaic chip %s to %s (xbin,ybin: %d,%d to %d,%d)\n",
    3149            in->name, out->name, in->xBin, in->yBin, out->xBin, out->yBin);
     
    3452    // image products pure trimmed images, but also increases the memory footprint.
    3553    status = pmChipMosaic(outChip, inChip, true, options->blankMask);
     54
     55    // Restore dark structure
     56    if (darkNumbers) {
     57        for (int i = 0; i < inChip->cells->n; i++) {
     58            pmCell *cell = inChip->cells->data[i];
     59            if (!cell) {
     60                continue;
     61            }
     62            cell->readouts->n = darkNumbers->data.S32[i];
     63        }
     64        psFree(darkNumbers);
     65    }
     66
    3667    return status;
    3768}
Note: See TracChangeset for help on using the changeset viewer.