IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 17, 2007, 1:53:35 PM (19 years ago)
Author:
Paul Price
Message:

Using weight maps in ppStack.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src/ppStackReadout.c

    r13613 r14275  
    4545
    4646        float seeing = psMetadataLookupF32(NULL, inputFile->fpa->analysis, "PPSTACK.SEEING"); // Seeing FWHM
    47         float weight = psMetadataLookupF32(NULL, inputFile->fpa->analysis, "PPSTACK.WEIGHT"); // Rel. weight
     47        float weighting = psMetadataLookupF32(NULL, inputFile->fpa->analysis,
     48                                              "PPSTACK.WEIGHTING"); // Relative weighting
    4849        float scale = psMetadataLookupF32(NULL, inputFile->fpa->analysis, "PPSTACK.SCALE"); // Rel. scale
    4950
     
    7778        totExposure += exposure;        // Total exposure time
    7879        (void)psBinaryOp(ro->image, ro->image, "/", psScalarAlloc(exposure, PS_TYPE_F32));
    79         pmStackData *data = pmStackDataAlloc(ro, seeing, weight); // Data to stack
     80        if (ro->weight) {
     81            (void)psBinaryOp(ro->weight, ro->weight, "/", psScalarAlloc(exposure, PS_TYPE_F32));
     82        }
     83        pmStackData *data = pmStackDataAlloc(ro, seeing, weighting); // Data to stack
    8084        psArrayAdd(stack, ARRAY_BUFFER, data);
    8185        psFree(data);                   // Drop reference
     
    100104    }
    101105
    102 #if 1
     106#ifdef INSPECTION_FILES
    103107    {
    104108        psFits *fits = psFitsOpen("combined.fits", "w");
     
    131135    }
    132136
    133 #if 1
     137#ifdef REJECTION_FILES
    134138    for (int i = 0; i < num; i++) {
    135139        pmStackData *data = stack->data[i]; // Data for this image
     
    157161    // Restore image to counts using the total exposure time
    158162    (void)psBinaryOp(outRO->image, outRO->image, "*", psScalarAlloc(totExposure, PS_TYPE_F32));
     163    if (outRO->weight) {
     164        (void)psBinaryOp(outRO->weight, outRO->weight, "*", psScalarAlloc(totExposure, PS_TYPE_F32));
     165    }
    159166    psMetadataAddF32(outRO->parent->concepts, PS_LIST_TAIL, "CELL.EXPOSURE", PS_META_REPLACE,
    160167                     "Summed exposure time (sec)", totExposure);
Note: See TracChangeset for help on using the changeset viewer.