IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 3, 2009, 11:58:24 AM (17 years ago)
Author:
Paul Price
Message:

Committing changes in progress. Attempting to make ppSub spit out not just the regular subtracted image and sources, but the inverse with sources in the inverse (for the warp-warp difference). Does not compile yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/pap/ppSub/src/ppSubDefineOutput.c

    r23403 r23704  
    2121#include "ppSub.h"
    2222
    23 bool ppSubDefineOutput(pmConfig *config, const pmFPAview *view)
     23bool ppSubDefineOutput(const char *name, pmConfig *config, const ppSubData *data, const pmFPAview *view)
    2424{
     25    psAssert(name, "Require name");
    2526    psAssert(config, "Require configuration");
    2627    psAssert(view, "Require view");
    2728
    28     pmCell *outCell = pmFPAfileThisCell(config->files, view, "PPSUB.OUTPUT"); // Output cell
     29    pmCell *outCell = pmFPAfileThisCell(config->files, view, name); // Output cell
    2930    pmFPA *outFPA = outCell->parent->parent; // Output FPA
    3031    pmHDU *outHDU = outFPA->hdu; // Output HDU
     
    3334    }
    3435
    35     // generate an output readout (first check if it's already there by virtue of kernels)
    36     pmReadout *outRO = pmFPAfileThisReadout(config->files, view, "PPSUB.OUTPUT.KERNELS"); // RO with kernel
    37     if (!outRO) {
    38         outRO = pmReadoutAlloc(outCell); // Output readout: subtraction
     36    pmReadout *outRO = NULL;            // Output readout
     37    if (outCell->readouts && outCell->readouts->n > 0 && outCell->readouts->data[0]) {
     38        outRO = psMemIncrRefCounter(outCell->readouts->data[0]);
     39    } else {
     40        outRO = pmReadoutAlloc(outCell);
    3941    }
    4042
     
    5557    if (!kernels) {
    5658        psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find SUBTRACTION.KERNEL");
    57         psFree(inConv);
    58         psFree(refConv);
    5959        psFree(outRO);
    6060        return false;
     
    6565    outRO->analysis = psMetadataCopy(outRO->analysis, analysis);
    6666
    67 #ifdef TESTING
    68     {
    69         psImage *kernelImage = psMetadataLookupPtr(&mdok, analysis,
    70                                                    "SUBTRACTION.KERNEL.IMAGE"); // Image of kernel
    71         psFits *fits = psFitsOpen("kernel.fits", "w");
    72         psFitsWriteImage(fits, NULL, kernelImage, 0, NULL);
    73         psFitsClose(fits);
    74     }
    75 #endif
     67    psFree(outRO);
    7668
    7769    return true;
Note: See TracChangeset for help on using the changeset viewer.