IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 3, 2008, 9:50:19 AM (18 years ago)
Author:
Paul Price
Message:

Threading stacks. Following the same scheme as for ppMerge, but cleaned up some. Rejection stage still needs to be threaded.

File:
1 edited

Legend:

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

    r19267 r19337  
    1212//#define TESTING                  // Write debugging output?
    1313
    14 
    15 bool ppStackReadoutInitial(const pmConfig *config, pmReadout *outRO, const psArray *readouts,
    16                            const psArray *regions, const psArray *kernels)
     14bool ppStackReadoutInitialThread(psThreadJob *job)
     15{
     16    PS_ASSERT_THREAD_JOB_NON_NULL(job, false);
     17
     18    psArray *args = job->args;          // Arguments
     19    ppStackThread *thread = args->data[0]; // Thread
     20    pmConfig *config = args->data[1];   // Configuration
     21    pmReadout *outRO = args->data[2];   // Output readout
     22    psArray *subRegions = args->data[3]; // Regions for PSF-matching
     23    psArray *subKernels = args->data[4]; // Kernels for PSF-matching
     24
     25    psArray *inspect = ppStackReadoutInitial(config, outRO, thread->readouts, subRegions, subKernels);
     26
     27    job->results = inspect;
     28    thread->busy = false;
     29
     30    return inspect ? true : false;
     31}
     32
     33bool ppStackReadoutFinalThread(psThreadJob *job)
     34{
     35    PS_ASSERT_THREAD_JOB_NON_NULL(job, false);
     36
     37    psArray *args = job->args;          // Arguments
     38    ppStackThread *thread = args->data[0]; // Thread
     39    pmConfig *config = args->data[1];   // Configuration
     40    pmReadout *outRO = args->data[2];   // Output readout
     41    psArray *rejected = args->data[3];  // Rejected pixels
     42
     43    bool status = ppStackReadoutFinal(config, outRO, thread->readouts, rejected); // Status of operation
     44
     45    thread->busy = false;
     46
     47    return status;
     48}
     49
     50
     51psArray *ppStackReadoutInitial(const pmConfig *config, pmReadout *outRO, const psArray *readouts,
     52                               const psArray *regions, const psArray *kernels)
    1753{
    1854    assert(config);
     
    88124
    89125    // Save list of pixels to inspect
     126    psArray *inspect = psArrayAlloc(num); // List of pixels to inspect
    90127    for (int i = 0; i < num; i++) {
    91128        pmStackData *data = stack->data[i]; // Data for this image
     
    97134            continue;
    98135        }
    99         psMetadataAddPtr(readout->analysis, PS_LIST_TAIL, PPSTACK_INSPECT_PIXELS,
    100                          PS_DATA_PIXELS | PS_META_DUPLICATE_OK, "Pixels to inspect from initial combination",
    101                          data->inspect);
     136        inspect->data[i] = psMemIncrRefCounter(data->inspect);
    102137    }
    103138    psFree(stack);
     
    105140    sectionNum++;
    106141
    107     return true;
     142    return inspect;
    108143}
    109144
Note: See TracChangeset for help on using the changeset viewer.