IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 17, 2009, 12:08:50 PM (17 years ago)
Author:
beaumont
Message:

merged with head

Location:
branches/cnb_branches/cnb_branch_20090301
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/cnb_branches/cnb_branch_20090301

  • branches/cnb_branches/cnb_branch_20090301/ppStack

  • branches/cnb_branches/cnb_branch_20090301/ppStack/src/ppStackThread.c

    r21477 r23352  
    99
    1010#include "ppStack.h"
     11#include "ppStackOptions.h"
     12#include "ppStackThread.h"
     13
    1114
    1215#define THREAD_WAIT 10000               // Microseconds to wait if thread is not available
     
    3639    psFree(stack->threads);
    3740    for (int i = 0; i < stack->imageFits->n; i++) {
    38         psFitsClose(stack->imageFits->data[i]);
    39         psFitsClose(stack->maskFits->data[i]);
    40         psFitsClose(stack->varianceFits->data[i]);
     41        if (stack->imageFits->data[i]) {
     42            psFitsClose(stack->imageFits->data[i]);
     43        }
     44        if (stack->maskFits->data[i]) {
     45            psFitsClose(stack->maskFits->data[i]);
     46        }
     47        if (stack->varianceFits->data[i]) {
     48            psFitsClose(stack->varianceFits->data[i]);
     49        }
    4150        stack->imageFits->data[i] = stack->maskFits->data[i] = stack->varianceFits->data[i] = NULL;
    4251    }
     
    4756}
    4857
    49 ppStackThreadData *ppStackThreadDataSetup(const psArray *cells, const psArray *imageNames,
    50                                           const psArray *maskNames, const psArray *varianceNames,
    51                                           const psArray *covariances, const pmConfig *config)
    52 {
     58ppStackThreadData *ppStackThreadDataSetup(const ppStackOptions *options, const pmConfig *config)
     59{
     60    psAssert(options, "Require options");
     61    psAssert(config, "Require configuration");
     62
     63    const psArray *cells = options->cells; // Array of input cells
     64    const psArray *imageNames = options->imageNames; // Names of images to read
     65    const psArray *maskNames = options->maskNames; // Names of masks to read
     66    const psArray *varianceNames = options->varianceNames; // Names of variance maps to read
     67    const psArray *covariances = options->covariances; // Covariance matrices (already read)
     68
    5369    PS_ASSERT_ARRAY_NON_NULL(cells, NULL);
    5470    PS_ASSERT_ARRAYS_SIZE_EQUAL(cells, imageNames, NULL);
     
    239255
    240256    {
    241         psThreadTask *task = psThreadTaskAlloc("PPSTACK_INITIAL_COMBINE", 6);
     257        psThreadTask *task = psThreadTaskAlloc("PPSTACK_INITIAL_COMBINE", 3);
    242258        task->function = &ppStackReadoutInitialThread;
    243259        psThreadTaskAdd(task);
     
    253269
    254270    {
    255         psThreadTask *task = psThreadTaskAlloc("PPSTACK_FINAL_COMBINE", 7);
     271        psThreadTask *task = psThreadTaskAlloc("PPSTACK_FINAL_COMBINE", 3);
    256272        task->function = &ppStackReadoutFinalThread;
    257273        psThreadTaskAdd(task);
Note: See TracChangeset for help on using the changeset viewer.