IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 18, 2010, 12:01:15 PM (16 years ago)
Author:
Paul Price
Message:

Reworking ppStack to not grow the rejected pixels for the unconvolved stack. Also working with convolved and unconvolved stacks separately, so they don't have to be in memory at the same time. This should reduce the memory usage of ppStack.

File:
1 edited

Legend:

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

    r27309 r27319  
    111111
    112112    // Prepare for combination
    113     if (!ppStackCombinePrepare(stack, options, config)) {
     113    if (!ppStackCombinePrepare(&options->outRO, "PPSTACK.OUTPUT", PPSTACK_FILES_STACK,
     114                               stack, options, config)) {
    114115        psError(psErrorCodeLast(), false, "Unable to prepare for combination.");
    115116        psFree(stack);
     
    148149    // Final combination
    149150    psTrace("ppStack", 2, "Final stack of convolved images....\n");
    150     if (!ppStackCombineFinal(options->outRO, stack, options->convCovars, options, config, false, false)) {
     151    if (!ppStackCombineFinal(options->outRO, stack, options->convCovars, options, config,
     152                             false, false, true)) {
    151153        psError(psErrorCodeLast(), false, "Unable to perform final combination.");
    152154        psFree(stack);
     
    163165        return false;
    164166    }
    165     psLogMsg("ppStack", PS_LOG_INFO, "Stage 6: Cleanup, WCS & JPEGS: %f sec", psTimerClear("PPSTACK_STEPS"));
     167
     168    // Photometry
     169    psTrace("ppStack", 1, "Photometering stacked image....\n");
     170    if (!ppStackPhotometry(options, config)) {
     171        psError(psErrorCodeLast(), false, "Unable to perform photometry.");
     172        return false;
     173    }
     174    psLogMsg("ppStack", PS_LOG_INFO, "Stage 6: Photometry Analysis: %f sec", psTimerClear("PPSTACK_STEPS"));
     175    ppStackMemDump("photometry");
     176
     177    if (!ppStackFilesIterateUp(config)) {
     178        psError(psErrorCodeLast(), false, "Unable to close files.");
     179        return false;
     180    }
     181    ppStackFileActivation(config, PPSTACK_FILES_STACK, false);
     182    ppStackFileActivation(config, PPSTACK_FILES_PHOT, false);
     183    options->outRO->data_exists = false;
     184    options->outRO->parent->data_exists = false;
     185    options->outRO->parent->parent->data_exists = false;
     186    psFree(options->outRO);
     187    options->outRO = NULL;
     188
     189    psLogMsg("ppStack", PS_LOG_INFO, "Stage 7: Cleanup, WCS & JPEGS: %f sec", psTimerClear("PPSTACK_STEPS"));
    166190    ppStackMemDump("cleanup");
    167191
     
    177201            return false;
    178202        }
     203
     204        // Prepare for combination
     205        if (!ppStackCombinePrepare(&options->unconvRO, "PPSTACK.UNCONV", PPSTACK_FILES_UNCONV,
     206                                   stack, options, config)) {
     207            psError(psErrorCodeLast(), false, "Unable to prepare for combination.");
     208            psFree(stack);
     209            return false;
     210        }
     211
    179212        psTrace("ppStack", 2, "Stack of unconvolved images....\n");
    180         if (!ppStackCombineFinal(options->unconvRO, stack, options->origCovars, options, config, false, true)) {
     213        if (!ppStackCombineFinal(options->unconvRO, stack, options->origCovars, options, config,
     214                                 false, true, false)) {
    181215            psError(psErrorCodeLast(), false, "Unable to perform unconvolved combination.");
    182216            psFree(stack);
    183217            return false;
    184218        }
    185         psLogMsg("ppStack", PS_LOG_INFO, "Stage 7: Unconvolved Stack: %f sec", psTimerClear("PPSTACK_STEPS"));
     219        psLogMsg("ppStack", PS_LOG_INFO, "Stage 8: Unconvolved Stack: %f sec", psTimerClear("PPSTACK_STEPS"));
    186220        ppStackMemDump("unconv");
     221
     222        if (!ppStackFilesIterateUp(config)) {
     223            psError(psErrorCodeLast(), false, "Unable to close files.");
     224            psFree(stack);
     225            return false;
     226        }
     227        ppStackFileActivation(config, PPSTACK_FILES_UNCONV, false);
     228        options->unconvRO->data_exists = false;
     229        options->unconvRO->parent->data_exists = false;
     230        options->unconvRO->parent->parent->data_exists = false;
     231        psFree(options->unconvRO);
     232        options->unconvRO = NULL;
    187233
    188234        psFree(stack);
     
    190236    psFree(options->cells); options->cells = NULL;
    191237#endif
    192 
    193     // Photometry
    194     psTrace("ppStack", 1, "Photometering stacked image....\n");
    195     if (!ppStackPhotometry(options, config)) {
    196         psError(psErrorCodeLast(), false, "Unable to perform photometry.");
    197         return false;
    198     }
    199     psLogMsg("ppStack", PS_LOG_INFO, "Stage 8: Photometry Analysis: %f sec", psTimerClear("PPSTACK_STEPS"));
    200     ppStackMemDump("photometry");
    201238
    202239    // Finish up
Note: See TracChangeset for help on using the changeset viewer.