IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 11, 2008, 7:09:46 PM (18 years ago)
Author:
Paul Price
Message:

Since I'm throwing away the convolved image in ppStackMatch(), I need to extract the regions and kernels there.

File:
1 edited

Legend:

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

    r16407 r16408  
    1010
    1111#include "ppStack.h"
    12 
    13 #define ARRAY_BUFFER 16                 // Number to add to array at a time
    1412
    1513// Here follows lists of files for activation/deactivation at various stages.  Each must be NULL-terminated.
     
    327325#ifndef CONVOLVED_ALREADY
    328326        // Background subtraction, scaling and normalisation is performed automatically by the image matching
    329         if (!ppStackMatch(readout, sources, targetPSF, config)) {
     327        psArray *regions = NULL, *kernels = NULL; // Regions and kernels used in subtraction
     328        if (!ppStackMatch(readout, &regions, &kernels, sources, targetPSF, config)) {
    330329            psError(PS_ERR_UNKNOWN, false, "Unable to match image %d --- ignoring.", i);
    331330            psFree(sources);
     
    333332            return false;
    334333        }
     334
     335        subRegions->data[i] = regions;
     336        subKernels->data[i] = kernels;
    335337
    336338        // Write the temporary convolved files
     
    342344#endif
    343345
    344         // Extract the regions and solutions used in the image matching
    345         // This stops them from being freed when we iterate back up the FPA
    346         psArray *regions = psArrayAllocEmpty(ARRAY_BUFFER); // Array of regions
    347         {
    348             psMetadataIterator *iter = psMetadataIteratorAlloc(readout->analysis, PS_LIST_HEAD,
    349                                                                PM_SUBTRACTION_ANALYSIS_REGION); // Iterator
    350             psMetadataItem *item = NULL;// Item from iteration
    351             while ((item = psMetadataGetAndIncrement(iter))) {
    352                 assert(item->type == PS_DATA_REGION);
    353                 regions = psArrayAdd(regions, ARRAY_BUFFER, item->data.V);
    354             }
    355             psFree(iter);
    356         }
    357         psArray *kernels = psArrayAllocEmpty(ARRAY_BUFFER); // Array of kernels
    358         {
    359             psMetadataIterator *iter = psMetadataIteratorAlloc(readout->analysis, PS_LIST_HEAD,
    360                                                                PM_SUBTRACTION_ANALYSIS_KERNEL); // Iterator
    361             psMetadataItem *item = NULL;// Item from iteration
    362             while ((item = psMetadataGetAndIncrement(iter))) {
    363                 assert(item->type == PS_DATA_VECTOR);
    364                 kernels = psArrayAdd(kernels, ARRAY_BUFFER, item->data.V);
    365             }
    366             psFree(iter);
    367         }
    368         assert(regions->n == kernels->n);
    369 
    370         subRegions->data[i] = regions;
    371         subKernels->data[i] = kernels;
    372346        cells->data[i] = psMemIncrRefCounter(readout->parent);
    373 
    374347        filesIterateUp(config);
    375348    }
Note: See TracChangeset for help on using the changeset viewer.