IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 11, 2008, 6:12:19 PM (18 years ago)
Author:
Paul Price
Message:

Now reads temporary convolved images bit by bit. Updating the stacking process to use modern APIs (the kernel solution is now a part of the pmSubtractionKernels).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/pap_branch_080207/ppStack/src/ppStackReadout.c

    r16382 r16404  
    1010#include "ppStack.h"
    1111
     12
     13#define ARRAY_BUFFER 16                 // Number to add to array at a time
    1214#define WCS_TOLERANCE 0.001             // Tolerance for WCS
    1315
     
    2628    psMaskType maskBad = psMetadataLookupU8(NULL, config->arguments, "MASK.BAD"); // Value to mask
    2729    psMaskType maskBlank = psMetadataLookupU8(NULL, config->arguments, "MASK.BLANK"); // Mask for blank reg.
    28 //    float threshold = psMetadataLookupF32(NULL, config->arguments, "THRESHOLD.MASK"); // Threshold for mask deconvolution
     30    float threshold = psMetadataLookupF32(NULL, config->arguments, "THRESHOLD.MASK"); // Threshold for mask deconvolution
    2931
    3032    int num = readouts->n;              // Number of inputs
     
    4951            weighting = 1.0;
    5052        }
    51 
    52 #if 0
    53         // I don't think 'scale' is needed, since the convolution matches the scales
    54         float scale = psMetadataLookupF32(&mdok, fpa->analysis, "PPSTACK.SCALE"); // Rel. scale
    55         if (!mdok || !isfinite(scale)) {
    56             psWarning("No SCALE supplied for image %d --- set to unity.", i);
    57             scale = 1.0;
    58         }
    59 #endif
    6053
    6154        float exposure = psMetadataLookupF32(NULL, ro->parent->concepts, "CELL.EXPOSURE"); // Exposure time
     
    135128#endif
    136129
    137 
    138 
    139     // XXX THIS NEEDS WORK
    140 #if 0
    141130    for (int i = 0; i < num; i++) {
    142131        pmStackData *data = stack->data[i]; // Data for this image
    143132        pmReadout *readout = data->readout; // Readout for this image
    144 
    145 
    146         // XXX Need some other mechanism to get the subtraction kernel
    147 
    148133
    149134        // Extract the regions and solutions used in the image matching
     
    151136        {
    152137            psMetadataIterator *iter = psMetadataIteratorAlloc(readout->analysis, PS_LIST_HEAD,
    153                                                                "^SUBTRACTION.REGION$"); // Iterator
     138                                                               PM_SUBTRACTION_ANALYSIS_REGION); // Iterator
    154139            psMetadataItem *item = NULL;// Item from iteration
    155140            while ((item = psMetadataGetAndIncrement(iter))) {
     
    159144            psFree(iter);
    160145        }
    161         psArray *solutions = psArrayAllocEmpty(ARRAY_BUFFER); // Array of solutions
     146        psArray *kernels = psArrayAllocEmpty(ARRAY_BUFFER); // Array of kernels
    162147        {
    163148            psMetadataIterator *iter = psMetadataIteratorAlloc(readout->analysis, PS_LIST_HEAD,
    164                                                                "^SUBTRACTION.SOLUTION$"); // Iterator
     149                                                               PM_SUBTRACTION_ANALYSIS_KERNEL); // Iterator
    165150            psMetadataItem *item = NULL;// Item from iteration
    166151            while ((item = psMetadataGetAndIncrement(iter))) {
    167152                assert(item->type == PS_DATA_VECTOR);
    168                 solutions = psArrayAdd(solutions, ARRAY_BUFFER, item->data.V);
     153                kernels = psArrayAdd(kernels, ARRAY_BUFFER, item->data.V);
    169154            }
    170155            psFree(iter);
    171156        }
    172         assert(regions->n == solutions->n);
    173 
    174         pmSubtractionKernels *kernels = psMetadataLookupPtr(NULL, readout->analysis,
    175                                                             "SUBTRACTION.KERNEL"); // Kernels
    176 
    177         psPixels *reject = pmStackReject(data->pixels, threshold, regions,
    178                                          solutions, kernels); // List of pixels to reject
     157        assert(regions->n == kernels->n);
     158
     159        psPixels *reject = pmStackReject(data->pixels, threshold, regions, kernels); // Pixels to reject
    179160        psFree(data->pixels);
    180161        data->pixels = reject;
    181162
    182         psFree(solutions);
     163        psFree(kernels);
    183164        psFree(regions);
    184165    }
    185 #endif
    186 
    187166
    188167#ifdef REJECTION_FILES
Note: See TracChangeset for help on using the changeset viewer.