IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 5, 2011, 10:09:53 AM (15 years ago)
Author:
eugene
Message:

merging updates from trunk

Location:
branches/eam_branches/ipp-20110404/ppStack/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110404/ppStack/src/ppStackArguments.c

    r31158 r31442  
    204204        }
    205205        psArgumentRemove (argNum, &argc, argv);
    206         if (strcasecmp(argv[argNum], "NIGHTLY") && strcasecmp(argv[argNum], "DEEP") && strcasecmp(argv[argNum], "BEST_IQ")) {
     206        if (strcasecmp(argv[argNum], "NIGHTLY_STACK") && strcasecmp(argv[argNum], "DEEP_STACK") && strcasecmp(argv[argNum], "IQ_STACK")) {
    207207            psErrorStackPrint(stderr, "Invalid option for -stack-type %s (must be one of NIGHTLY_STACK, DEEP_STACK, IQ_STACK)", argv[argNum]);
    208208            exit(PS_EXIT_CONFIG_ERROR);
  • branches/eam_branches/ipp-20110404/ppStack/src/ppStackCombineFinal.c

    r31158 r31442  
    11#include "ppStack.h"
    22
    3 //#define TESTING                         // Enable test output
     3// This is the doomsday switch.
     4// #define TESTING                         // Enable test output
    45
    56bool ppStackCombineFinal(ppStackThreadData *stack, psArray *covariances, ppStackOptions *options,
     
    2930            reject->data[i] = pmStackRejectGrow(options->rejected->data[i], numCols, numRows, poorFrac,
    3031                                                options->regions->data[i], options->kernels->data[i]);
    31             if (!reject->data[i]) {
    32                 psError(psErrorCodeLast(), false, "Unable to grow rejected pixels for image %d", i);
    33                 psFree(reject);
    34                 return false;
    35             }
    3632        } else {
    3733            reject->data[i] = psMemIncrRefCounter(options->rejected->data[i]);
  • branches/eam_branches/ipp-20110404/ppStack/src/ppStackCombineInitial.c

    r31054 r31442  
    11#include "ppStack.h"
    22
    3 //#define TESTING                         // Enable test output
     3// This is the doomsday switch.
     4// #define TESTING                         // Enable test output
    45
    56bool ppStackCombineInitial(ppStackThreadData *stack, ppStackOptions *options, pmConfig *config)
     
    910    psAssert(config, "Require configuration");
    1011
    11     if (!options->convolve) {
    12         // No need to do initial combination when we haven't convolved
    13         // XXX either allocate inspect and rejected here, or do not require them downstream
    14         return true;
    15     }
     12/*     if (!options->convolve) { */
     13/*         // No need to do initial combination when we haven't convolved */
     14/*         // XXX either allocate inspect and rejected here, or do not require them downstream */
     15/*         return true; */
     16/*     } */
    1617
    1718    psTimerStart("PPSTACK_INITIAL");
  • branches/eam_branches/ipp-20110404/ppStack/src/ppStackLoop.c

    r31158 r31442  
    115115    // Final combination.  This one does NOT need to be normalized since the convolution takes care of that
    116116    psTrace("ppStack", 2, "Final stack of convolved images....\n");
    117     if (!ppStackCombineFinal(stack, options->convCovars, options, config, false, false, true)) {
     117    if (options->convolve) {
     118      if (!ppStackCombineFinal(stack, options->convCovars, options, config, false, false, true)) {
    118119        psError(psErrorCodeLast(), false, "Unable to perform final combination.");
    119120        psFree(stack);
    120121        return false;
    121     }
     122      }
     123    }
     124    else {
     125      // Since we haven't convolved, I believe we do need to normalize here.
     126      if (!ppStackCombineFinal(stack, options->convCovars, options, config, false, true, true)) {
     127        psError(psErrorCodeLast(), false, "Unable to perform final combination.");
     128        psFree(stack);
     129        return false;
     130      }
     131    }
     132     
    122133    psLogMsg("ppStack", PS_LOG_INFO, "Stage 5: Final Stack: %f sec", psTimerClear("PPSTACK_STEPS"));
    123134    ppStackMemDump("final");
     135
     136    // Update Header
     137    // Do this before performing photometry so that the cmf header gets all of the information.
     138    if (!ppStackUpdateHeader(stack, options, config)) {
     139        psError(psErrorCodeLast(), false, "Unable to update header.");
     140        psFree(stack);
     141        return false;
     142    }
    124143
    125144    // Photometry
     
    132151    ppStackMemDump("photometry");
    133152
    134     // Update Header
    135     if (!ppStackUpdateHeader(stack, options, config)) {
    136         psError(psErrorCodeLast(), false, "Unable to update header.");
    137         psFree(stack);
    138         return false;
    139     }
    140153    // Create JPEGS
    141154    if (!ppStackJPEGs(stack, options, config)) {
  • branches/eam_branches/ipp-20110404/ppStack/src/ppStackReject.c

    r31158 r31442  
    11#include "ppStack.h"
    22
     3// This is the doomsday switch.
    34// #define TESTING
    45
     
    89    psAssert(config, "Require configuration");
    910
     11/*     if (!options->convolve) { */
     12/*         // No need to do complicated rejection when we haven't convolved */
     13/*         return true; */
     14/*     } */
     15
     16   
     17    int num = options->num;             // Number of inputs
     18
     19    // Construct a small convolution kernel to aid in rejection
    1020    if (!options->convolve) {
    11         // No need to do complicated rejection when we haven't convolved
    12         return true;
     21      for (int i = 0; i < num; i++) {
     22        psArray *regions = psArrayAllocEmpty(1);
     23        psRegion *region = psRegionAlloc(0,options->numCols - 1, 0, options->numRows - 1);
     24        regions = psArrayAdd(regions,1, region);
     25       
     26        psArray *kernels = psArrayAllocEmpty(1);
     27        psVector *fwhms = psVectorAllocEmpty(1, PS_TYPE_F32);
     28        psVectorAppend(fwhms,5.0); // Should be a parameter
     29        psVector *orders = psVectorAllocEmpty(1, PS_TYPE_S32);
     30        psVectorAppend(orders,0);
     31        pmSubtractionKernels *kernel = pmSubtractionKernelsISIS(15,0,fwhms,orders,0,*region,PM_SUBTRACTION_MODE_2);
     32        kernels = psArrayAdd(kernels, 1, kernel);
     33       
     34        kernel->solution1 = psVectorAlloc(3, PS_TYPE_F64);
     35        psVectorSet(kernel->solution1, 1, 1.0);
     36        psVectorSet(kernel->solution1, 2, 1.0);
     37        psVectorSet(kernel->solution1, 3, 1.0);
     38        kernel->solution2 = psVectorAlloc(3, PS_TYPE_F64);
     39        psVectorSet(kernel->solution2, 1, 1.0);
     40        psVectorSet(kernel->solution1, 2, 1.0);
     41        psVectorSet(kernel->solution1, 3, 1.0);
     42       
     43        options->kernels->data[i] = kernels;
     44        options->regions->data[i] = regions;
     45      }
    1346    }
    14 
    15     int num = options->num;             // Number of inputs
     47       
    1648
    1749    psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSTACK_RECIPE); // ppStack recipe
Note: See TracChangeset for help on using the changeset viewer.