IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 3, 2009, 6:25:39 PM (17 years ago)
Author:
Paul Price
Message:

Still moving stuff around to support 'inverse' mode. Need to define separate output files for the sources. Still doesn't compile.

File:
1 edited

Legend:

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

    r23704 r23711  
    5555    }
    5656
     57    psMetadataAddF32(data->stats, PS_LIST_TAIL, "TIME_MATCH", 0, "Time to match PSFs",
     58                     psTimerClear("PPSUB_MATCH"));
     59
    5760    // Close input files
    5861    if (!ppSubFilesIterateUp(config, PPSUB_FILES_INPUT)) {
     
    7275    }
    7376
    74     if (data->inverse && !ppSubDefineOutput("PPSUB.OUTINV", config, data, view)) {
    75         psError(PS_ERR_UNKNOWN, false, "Unable to define inverse.");
     77    if (!data->quality && !ppSubMakePSF("PPSUB.OUTPUT", "PPSUB.INVERSE", config, data, view)) {
     78        psError(PS_ERR_UNKNOWN, false, "Unable to generate PSF.");
    7679        return false;
    7780    }
    7881
    79     if (!data->quality && !ppSubMakePSF("PPSUB.OUTPUT", "PPSUB.OUTINV", config, data, view)) {
    80         psError(PS_ERR_UNKNOWN, false, "Unable to generate PSF.");
     82    if (!ppSubReadoutSubtract("PPSUB.OUTPUT", config, view)) {
     83        psError(PS_ERR_UNKNOWN, false, "Unable to subtract images.");
    8184        return false;
    8285    }
     
    8891    }
    8992
    90     if (!ppSubReadoutSubtract("PPSUB.OUTPUT", config, view)) {
    91         psError(PS_ERR_UNKNOWN, false, "Unable to subtract images.");
    92         return false;
    93     }
    94 
    9593    // Higher order background subtraction using psphot
    96     if (!ppSubBackground("PPSUB.OUTPUT", config, view)) {
     94    if (!ppSubBackground(config, view)) {
    9795        psError(PS_ERR_UNKNOWN, false, "Unable to subtract background.");
    9896        return false;
    9997    }
    10098
    101     if (!data->quality && data->!ppSubReadoutPhotometry("PPSUB.OUTPUT", config, data, view)) {
     99    if (!data->quality && ppSubReadoutPhotometry("PPSUB.OUTPUT", PPSUB_FILES_PHOT_SUB, config, data, view)) {
    102100        psError(PS_ERR_UNKNOWN, false, "Unable to perform photometry.");
    103101        return false;
    104102    }
    105103
    106     if (!ppSubReadoutUpdate("PPSUB.OUTPUT", config, data, view)) {
    107         psError(PS_ERR_UNKNOWN, false, "Unable to update.");
     104    // Perform statistics on the cell
     105    if (!ppSubReadoutStats(config, data, view)) {
     106        psError(PS_ERR_UNKNOWN, false, "Unable to collect statistics");
    108107        return false;
    109108    }
    110109
    111     // Perform statistics on the cell
    112     if (statsFile) {
    113         pmFPAfile *output = psMetadataLookupPtr(NULL, config->files, "PPSUB.OUTPUT"); // Output file
    114         if (!output) {
    115             psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find file PPSUB.OUTPUT.\n");
    116             goto ERROR;
    117         }
    118         psImageMaskType maskValue = pmConfigMaskGet("MASK.VALUE", config);
    119         ppStatsFPA(data->stats, output->fpa, view, maskValue, config);
     110    if (!ppSubReadoutJpeg("PPSUB.OUTPUT", config, data, view)) {
     111        psError(PS_ERR_UNKNOWN, false, "Unable to update.");
     112        return false;
    120113    }
    121114
     
    127120        }
    128121
    129         if (!ppSubReadoutInverse("PPSUB.OUTINV", "PPSUB.OUTPUT", config, view)) {
     122        if (data->inverse && !ppSubDefineOutput("PPSUB.INVERSE", config, data, view)) {
     123            psError(PS_ERR_UNKNOWN, false, "Unable to define inverse.");
     124            return false;
     125        }
     126
     127        if (!ppSubReadoutInverse("PPSUB.INVERSE", "PPSUB.OUTPUT", config, view)) {
    130128            psError(PS_ERR_UNKNOWN, false, "Unable to invert images.");
    131129            return false;
     
    138136        }
    139137
    140         if (!data->quality && data->!ppSubReadoutPhotometry("PPSUB.OUTINV", config, data, view)) {
    141         psError(PS_ERR_UNKNOWN, false, "Unable to perform photometry.");
    142         return false;
     138        if (!data->quality && data->!ppSubReadoutPhotometry("PPSUB.INVERSE", PPSUB_FILES_PHOT_INV,
     139                                                            config, data, view)) {
     140            psError(PS_ERR_UNKNOWN, false, "Unable to perform photometry.");
     141            return false;
     142        }
     143
     144        // Close inverse subtraction files
     145        if (!ppSubFilesIterateUp(config, PPSUB_FILES_INV)) {
     146            psError(PPSUB_ERR_IO, false, "Unable to close subtraction files.");
     147            return false;
    143148        }
    144149    } else {
     
    149154        }
    150155    }
    151 
    152 
    153     if (!ppSubReadoutUpdate("PPSUB.OUTPUT", config, data, view)) {
    154         psError(PS_ERR_UNKNOWN, false, "Unable to update.");
    155         return false;
    156     }
    157 
    158156
    159157    psFree(view);
Note: See TracChangeset for help on using the changeset viewer.