IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35536


Ignore:
Timestamp:
May 8, 2013, 4:56:44 PM (13 years ago)
Author:
eugene
Message:

cleanup file activation calls

Location:
branches/eam_branches/ipp-20130419/pswarp/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130419/pswarp/src/pswarpCleanup.c

    r35521 r35536  
    1111
    1212# include "pswarp.h"
    13 # include "pswarpFileNames.h"
     13
     14// Lists of file rules which we may need to save here
     15static char *outputFiles[] = {
     16  "PSWARP.OUTPUT",
     17  "PSWARP.OUTPUT.MASK",
     18  "PSWARP.OUTPUT.VARIANCE",
     19  "PSWARP.OUTPUT.BKGMODEL",
     20  "PSWARP.OUTPUT.SOURCES",
     21  "PSPHOT.INPUT",
     22  "PSPHOT.OUTPUT",
     23  "PSPHOT.RESID",
     24  "PSPHOT.BACKMDL",
     25  "PSPHOT.BACKMDL.STDEV",
     26  "PSPHOT.BACKGND",
     27  "PSPHOT.BACKSUB",
     28  "PSPHOT.PSF.SAVE",
     29  "SOURCE.PLOT.MOMENTS",
     30  "SOURCE.PLOT.PSFMODEL",
     31  "SOURCE.PLOT.APRESID",
     32  NULL
     33};
    1434
    1535void pswarpCleanup (pmConfig *config, pswarpStatsFile *statsFile)
     
    1737    psExit exitValue = pswarpExitCode(PS_EXIT_SUCCESS); // Exit code
    1838
    19     // Ensure everything is written out, at every level
    20     pswarpFileActivation(config, detectorFiles, false);
    21     pswarpFileActivation(config, independentFiles, false);
    22 
    23     pswarpFileActivation(config, photFiles, true);
    24     pswarpFileActivation(config, skycellFiles, true);
    25     pmFPAfileActivate(config->files, true, "PSWARP.OUTPUT.SOURCES");
     39    // activate all of the relevant output files
     40    pmFPAfileActivate(config->files, false, NULL);
     41    for (int i = 0; outputFiles[i] != NULL; i++) {
     42        pmFPAfileActivate(config->files, true, outputFiles[i]);
     43    }
    2644
    2745    pmFPAfile *output = psMetadataLookupPtr(NULL, config->files, "PSWARP.OUTPUT");
  • branches/eam_branches/ipp-20130419/pswarp/src/pswarpLoop.c

    r35535 r35536  
    1111
    1212#include "pswarp.h"
    13 #include "pswarpFileNames.h"            // Lists of file rules used at different stages
    1413
    1514// Loop over the inputs, warp them to the output skycell and then update metadata
     
    4746    }
    4847
     48    // load in the input pixel data (ex. background model)
     49    pmFPAfileActivate(config->files, false, NULL);
     50    pmFPAfileActivate(config->files, true, "PSWARP.INPUT");
     51    pmFPAfileActivate(config->files, true, "PSWARP.MASK");
     52    pmFPAfileActivate(config->files, true, "PSWARP.VARIANCE");
     53
     54    // We re-activate the CMF load so we can transform the sources as well as the pixels.
     55    // We only need to read in these if the astrometry source is CMF.
     56    pmFPAfileActivate(config->files, true, "PSWARP.ASTROM");
     57
    4958    // loop over this section once per input group
    5059    for (int i = 0; i < nInputs; i++) {
     
    6170            astrom = input;
    6271        }
    63 
    64         // ensure everyone is off except what we need below
    65         // XXX double-check activation issues in general
    66         pswarpFileActivation(config, detectorFiles, true);
    67         pswarpFileActivation(config, photFiles, false);
    68         pswarpFileActivation(config, independentFiles, false);
    69         pswarpFileActivation(config, skycellFiles, false);
    70    
    71         // We re-activate the CMF load so we can transform the sources as well as the pixels.
    72         // We only need to read in these if the astrometry source is CMF.
    73         pmFPAfileActivate(config->files, true, "PSWARP.ASTROM");
    7472
    7573        pmFPAviewReset (view);
     
    146144        }
    147145
    148         // Done with the detector side of things
    149         pswarpFileActivation(config, detectorFiles, false);
    150         pswarpFileActivation(config, independentFiles, false);
    151 
    152146        if (!pswarpUpdateStatistics (output->fpa, stats, input->fpa, astrom->fpa, config)) {
    153147            psError(psErrorCodeLast(), false, "problem generating statistics.");
  • branches/eam_branches/ipp-20130419/pswarp/src/pswarpLoopBackground.c

    r35535 r35536  
    1111
    1212#include "pswarp.h"
    13 #include "pswarpFileNames.h"            // Lists of file rules used at different stages
    1413
    1514#define WCS_NONLIN_TOL 0.001            // Non-linear tolerance for header WCS
     
    5857        return false;
    5958    }
     59
     60    // we are only reading the background models, not writing anything
     61    pmFPAfileActivate(config->files, false, NULL);
     62    pmFPAfileActivate(config->files, true, "PSWARP.BKGMODEL");
    6063
    6164    // loop over this section once per input group
     
    8386            input->fpa->toSky = psMemIncrRefCounter (astrom->fpa->toSky);
    8487        }
    85 
    86         // we only need to load the background models here
    87         pswarpFileActivation(config, detectorFiles, false);
    88         pswarpFileActivation(config, photFiles, false);
    89         pswarpFileActivation(config, independentFiles, false);
    90         pswarpFileActivation(config, skycellFiles, false);
    91 
    92         // we are only reading the background models, not writing anything
    93         pmFPAfileActivate(config->files, true, "PSWARP.BKGMODEL");
    9488
    9589        pmFPAviewReset (view);
Note: See TracChangeset for help on using the changeset viewer.