IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 27, 2009, 1:26:55 PM (17 years ago)
Author:
Paul Price
Message:

Can now combine images without convolving, but it doesn't apply any rejection yet.

File:
1 edited

Legend:

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

    r23371 r23576  
    5151    bool status = false;                // Status of file definition
    5252
     53    psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSTACK_RECIPE); // Recipe for ppSim
     54    if (!recipe) {
     55        psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find recipe %s", PPSTACK_RECIPE);
     56        return false;
     57    }
     58    bool convolve = psMetadataLookupBool(NULL, recipe, "CONVOLVE"); // Convolve images before stack?
     59
    5360    psArray *runImages = pmFPAfileDefineMultipleFromRun(&status, NULL, config,
    5461                                                        "PPSTACK.INPUT"); // Input images from previous run
     
    98105        }
    99106        if (!runSrc) {
    100             psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to define input sources from RUN metadta.");
     107            psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to define input sources from RUN metadata.");
    101108            psFree(runImages);
    102109            return false;
     
    104111        psFree(runSrc);
    105112
    106         psArray *runKernel = pmFPAfileDefineMultipleFromRun(&status, runImages, config,
    107                                                             "PPSTACK.CONV.KERNEL"); // Convolution kernels
    108         if (!status) {
    109             psError(PS_ERR_UNKNOWN, false, "Unable to define convolution kernels from RUN metadata.");
    110             psFree(runImages);
    111             return false;
    112         }
    113         if (!runSrc) {
    114             psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to define convolution kernels from RUN metadta.");
    115             psFree(runImages);
    116             return false;
    117         }
    118         psFree(runKernel);
     113        if (convolve) {
     114            psArray *runKernel = pmFPAfileDefineMultipleFromRun(&status, runImages, config,
     115                                                                "PPSTACK.CONV.KERNEL"); // Convolution kernels
     116            if (!status) {
     117                psError(PS_ERR_UNKNOWN, false, "Unable to define convolution kernels from RUN metadata.");
     118                psFree(runImages);
     119                return false;
     120            }
     121            if (!runKernel) {
     122                psError(PS_ERR_UNEXPECTED_NULL, true,
     123                        "Unable to define convolution kernels from RUN metadata.");
     124                psFree(runImages);
     125                return false;
     126            }
     127            psFree(runKernel);
     128        }
    119129
    120130        psFree(runImages);
     
    200210            }
    201211
    202             pmFPAfile *kernel = pmFPAfileDefineOutput(config, imageFile->fpa, "PPSTACK.CONV.KERNEL");
    203             if (!kernel) {
    204                 psError(PS_ERR_IO, false, _("Unable to generate output file from PPSTACK.CONV.KERNEL"));
    205                 return false;
    206             }
    207             kernel->save = true;
     212            if (convolve) {
     213                pmFPAfile *kernel = pmFPAfileDefineOutput(config, imageFile->fpa, "PPSTACK.CONV.KERNEL");
     214                if (!kernel) {
     215                    psError(PS_ERR_IO, false, _("Unable to generate output file from PPSTACK.CONV.KERNEL"));
     216                    return false;
     217                }
     218                kernel->save = true;
     219            }
    208220
    209221            i++;
     
    300312    }
    301313    jpeg2->save = true;
    302 
    303 
    304     psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSTACK_RECIPE); // Recipe for ppSim
    305     if (!recipe) {
    306         psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find recipe %s", PPSTACK_RECIPE);
    307         return false;
    308     }
    309314
    310315    // For photometry, we operate on the chip-mosaicked image
Note: See TracChangeset for help on using the changeset viewer.