IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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

warping of background model appears to work

File:
1 edited

Legend:

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

    r35527 r35535  
    11/** @file pswarpLoop.c
    22 *
    3  *  @brief mail processing loop for pswarp
     3 *  @brief main processing loop for pswarp
    44 *  @ingroup pswarp
    55 *
     
    1313#include "pswarpFileNames.h"            // Lists of file rules used at different stages
    1414
    15 // Loop over the inputs, warp them to the output skycell and then write out the output.
     15// Loop over the inputs, warp them to the output skycell and then update metadata
    1616bool pswarpLoop(pmConfig *config, psMetadata *stats)
    1717{
    18     const char *skyCamera = psMetadataLookupStr(NULL, config->arguments,
    19                                                 "SKYCELL.CAMERA");  // Name of camera for skycell
    20     pmConfigCamerasCull(config, skyCamera);
    21     pmConfigRecipesCull(config, "PSWARP,PPSTATS,PSPHOT,PSASTRO,MASKS,JPEG");
    2218
    2319    // load the recipe
     
    2622    if (!recipe) {
    2723        psError(PSWARP_ERR_CONFIG, false, "missing recipe %s", PSWARP_RECIPE);
    28         return false;
    29     }
    30 
    31     // XXX move this to pswarpParseCamera?  has to come after input mask header is read
    32     if (!pswarpSetMaskBits(config)) {
    33         psError(psErrorCodeLast(), false, "failed to set mask bits");
    3424        return false;
    3525    }
     
    6656        }
    6757
    68         fprintf (stderr, "loading file %s\n", input->filename);
    69 
    70         // use the external astrometry source if supplied
     58        // select the input data sources
    7159        pmFPAfile *astrom = pmFPAfileSelectSingle(config->files, "PSWARP.ASTROM", i);
    7260        if (!astrom) {
     
    7462        }
    7563
    76         if (astrom->camera != input->camera) {
    77             psError(PSWARP_ERR_DATA, true, "Input camera and astrometry camera do not match.");
    78             return false;
    79         }
    80 
    81         // ensure everyone is off except what we need below
    82         pswarpFileActivation(config, detectorFiles, false);
     64        // ensure everyone is off except what we need below
     65        // XXX double-check activation issues in general
     66        pswarpFileActivation(config, detectorFiles, true);
    8367        pswarpFileActivation(config, photFiles, false);
    8468        pswarpFileActivation(config, independentFiles, false);
    8569        pswarpFileActivation(config, skycellFiles, false);
    8670   
    87         // the loops below load the input data
    88         pswarpFileActivation(config, detectorFiles, true);
    89 
    90         // need to read in these (but only if CMF, right?)
     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.
    9173        pmFPAfileActivate(config->files, true, "PSWARP.ASTROM");
    92 
    93         // pswarpFileActivation(config, independentFiles, true);
    9474
    9575        pmFPAviewReset (view);
     
    174154            goto FAIL;
    175155        }
    176         if (!pswarpUpdateMetadata (output->fpa, input->fpa, astrom->fpa, config)) {
     156        if (!pswarpUpdateMetadata (output->fpa, skycell->fpa, input->fpa, astrom->fpa, config, true)) {
    177157            psError(psErrorCodeLast(), false, "problem generating statistics.");
    178158            goto FAIL;
     
    184164      goto FAIL;
    185165    }
    186 
    187     // XXX
    188     // pswarpDumpOutput (config);
    189     // exit (0);
    190166
    191167    psFree(view);
     
    196172    return false;
    197173}
    198 
    199 // static int Nout = 0;
    200174
    201175// once the output fpa elements have been built, loop over the fpa and generate stats
     
    219193            while ((readout = pmFPAviewNextReadout(view, output, 1)) != NULL) {
    220194                pswarpTransformReadout (readout, input, config);
    221                 // char name[64];
    222                 // snprintf (name, 64, "dumpwarp.%02d.fits", Nout);
    223                 // Nout ++;
    224                 //
    225                 // psphotSaveImage (NULL, readout->image, name);
    226195            }
    227196        }
Note: See TracChangeset for help on using the changeset viewer.