IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 6, 2009, 6:52:51 PM (17 years ago)
Author:
Paul Price
Message:

Making ppSub inverse mode work. Seems to work now --- produces the correct output files for inverse mode on and off, photometry on and off.

Location:
branches/pap/ppSub/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/pap/ppSub/src

    • Property svn:ignore
      •  

        old new  
        1010stamp-h1
        1111ppSubKernel
         12ppSubErrorCodes.h
         13ppSubErrorCodes.c
  • branches/pap/ppSub/src/ppSubLoop.c

    r23711 r23719  
    1717#include <pslib.h>
    1818#include <psmodules.h>
    19 #include <ppStats.h>
    2019
    2120#include "ppSub.h"
     
    7069    }
    7170
    72     if (!ppSubDefineOutput("PPSUB.OUTPUT", config, data, view)) {
     71    if (!ppSubDefineOutput("PPSUB.OUTPUT", config)) {
    7372        psError(PS_ERR_UNKNOWN, false, "Unable to define output.");
    7473        return false;
    7574    }
    7675
    77     if (!data->quality && !ppSubMakePSF("PPSUB.OUTPUT", "PPSUB.INVERSE", config, data, view)) {
     76    if (!data->quality && !ppSubMakePSF(config, data)) {
    7877        psError(PS_ERR_UNKNOWN, false, "Unable to generate PSF.");
    7978        return false;
    8079    }
    8180
    82     if (!ppSubReadoutSubtract("PPSUB.OUTPUT", config, view)) {
     81    if (!ppSubReadoutSubtract(config)) {
    8382        psError(PS_ERR_UNKNOWN, false, "Unable to subtract images.");
    8483        return false;
     
    8685
    8786    // Close convolved files
    88     if (!ppSubFilesIterateUp(config, PPSUB_FILES_CONV)) {
     87    if (!ppSubFilesIterateUp(config, PPSUB_FILES_PSF | PPSUB_FILES_CONV)) {
    8988        psError(PPSUB_ERR_IO, false, "Unable to close input files.");
    9089        return false;
     
    9291
    9392    // Higher order background subtraction using psphot
    94     if (!ppSubBackground(config, view)) {
     93    if (!ppSubBackground(config)) {
    9594        psError(PS_ERR_UNKNOWN, false, "Unable to subtract background.");
    9695        return false;
    9796    }
    9897
    99     if (!data->quality && ppSubReadoutPhotometry("PPSUB.OUTPUT", PPSUB_FILES_PHOT_SUB, config, data, view)) {
     98    if (!ppSubFilesIterateDown(config, PPSUB_FILES_PHOT_SUB)) {
     99        psError(PPSUB_ERR_IO, false, "Unable to set up photometry files.");
     100        return false;
     101    }
     102
     103    if (!data->quality && !ppSubReadoutPhotometry("PPSUB.OUTPUT", config, data)) {
    100104        psError(PS_ERR_UNKNOWN, false, "Unable to perform photometry.");
    101105        return false;
    102106    }
    103107
     108    if (!ppSubFilesIterateUp(config, PPSUB_FILES_PHOT_SUB)) {
     109        psError(PPSUB_ERR_IO, false, "Unable to set up photometry files.");
     110        return false;
     111    }
     112
    104113    // Perform statistics on the cell
    105     if (!ppSubReadoutStats(config, data, view)) {
     114    if (!ppSubReadoutStats(config, data)) {
    106115        psError(PS_ERR_UNKNOWN, false, "Unable to collect statistics");
    107116        return false;
    108117    }
    109118
    110     if (!ppSubReadoutJpeg("PPSUB.OUTPUT", config, data, view)) {
     119    if (!ppSubReadoutJpeg(config)) {
    111120        psError(PS_ERR_UNKNOWN, false, "Unable to update.");
    112121        return false;
     
    120129        }
    121130
    122         if (data->inverse && !ppSubDefineOutput("PPSUB.INVERSE", config, data, view)) {
     131        if (data->inverse && !ppSubDefineOutput("PPSUB.INVERSE", config)) {
    123132            psError(PS_ERR_UNKNOWN, false, "Unable to define inverse.");
    124133            return false;
    125134        }
    126135
    127         if (!ppSubReadoutInverse("PPSUB.INVERSE", "PPSUB.OUTPUT", config, view)) {
     136        if (!ppSubReadoutInverse(config)) {
    128137            psError(PS_ERR_UNKNOWN, false, "Unable to invert images.");
    129138            return false;
     
    136145        }
    137146
    138         if (!data->quality && data->!ppSubReadoutPhotometry("PPSUB.INVERSE", PPSUB_FILES_PHOT_INV,
    139                                                             config, data, view)) {
     147        if (!ppSubFilesIterateDown(config, PPSUB_FILES_PHOT_INV)) {
     148            psError(PPSUB_ERR_IO, false, "Unable to set up inverse files.");
     149            return false;
     150        }
     151
     152        if (!data->quality && !ppSubReadoutPhotometry("PPSUB.INVERSE", config, data)) {
    140153            psError(PS_ERR_UNKNOWN, false, "Unable to perform photometry.");
    141154            return false;
     
    143156
    144157        // Close inverse subtraction files
    145         if (!ppSubFilesIterateUp(config, PPSUB_FILES_INV)) {
     158        if (!ppSubFilesIterateUp(config, PPSUB_FILES_INV | PPSUB_FILES_PHOT_INV)) {
    146159            psError(PPSUB_ERR_IO, false, "Unable to close subtraction files.");
    147160            return false;
     
    155168    }
    156169
    157     psFree(view);
    158 
    159     psString dump_file = psMetadataLookupStr(&mdok, config->arguments, "-dumpconfig");
     170    psString dump_file = psMetadataLookupStr(NULL, config->arguments, "-dumpconfig");
    160171    if (dump_file) {
    161172        pmFPAfile *input = psMetadataLookupPtr(NULL, config->files, "PPSUB.INPUT"); // Input file
     
    164175
    165176    return true;
    166 
    167 ERROR:
    168     return false;
    169177}
Note: See TracChangeset for help on using the changeset viewer.