IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 11, 2006, 5:27:13 PM (20 years ago)
Author:
eugene
Message:

major revisions to use the new pmFPAfile,view I/O handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/testPSphotLoop.c

    r6522 r6571  
    11# include "psphot.h"
    22
    3 bool psphotLoop (psphotData *data, ppConfig *config) {
     3bool psphotImageLoop (pmConfig *config) {
    44
    5     psRegion region = {0,0,0,0};
    6     pmFPA *fpa = data->input->fpa;
    7     pmFPAiterator *fpi = pmFPAiteratorAlloc (fpa, region);
     5    psMetadata *recipe = psMetadataLookupPts (NULL, config->recipes, PSPHOT_RECIPE);
     6    if (!recipe) {
     7        psErrorStackPrint(stderr, "Can't find recipe configuration!\n");
     8        exit(EXIT_FAILURE);
     9    }
     10
     11    pmFPA *input = psMetadataLookupPtr (&status, config->files, "PSPHOT.INPUT");
     12    pmFPAview *view = pmFPAviewAlloc (0);
    813
    914    // files associated with the science image
    10     pmFileDefine (fpi, config->camera, "PPIMAGE.INPUT");
    11     pmFileDefine (fpi, config->camera, "PPIMAGE.OUTPUT.HEAD");
    12     pmFileDefine (fpi, config->camera, "PPIMAGE.OUTPUT.DATA");
    13     pmFileDefine (fpi, config->camera, "PPIMAGE.BACKGND");
    14     pmFileDefine (fpi, config->camera, "PPIMAGE.BACKSUB");
    15     pmFileDefine (fpi, config->camera, "PPIMAGE.RESID");
    16     pmFileDefine (fpi, config->camera, "PPIMAGE.PSF");
    17     pmFileIOChecks (fpi);
     15    pmFPAfileReadChecks (config->files, view);
    1816
    19     while ((chip = pmChipNext (fpi)) != NULL) {
     17    while ((chip = pmChipNext (view, input)) != NULL) {
    2018
    2119        psLogMsg ("psphot", 4, "Chip %d: %x %x\n", i, chip->exists, chip->process);
    2220        if (! chip->process) { continue; }
    23         pmFileIOChecks (fpi);
     21        pmFPAfileReadChecks (config->files, view);
    2422
    25         while ((cell = pmCellNext (fpi)) != NULL) {
     23        while ((cell = pmCellNext (view, input)) != NULL) {
    2624
    2725            psLogMsg ("psphot", 4, "Cell %d: %x %x\n", j, cell->exists, cell->process);
    2826            if (! cell->process) { continue; }
    29             pmFileIOChecks (fpi);
     27            pmFPAfileReadChecks (config->files, view);
     28
     29            // XXX optional mask and weight input image should be loaded here?
     30            // this sets the weight map and basic mask applying CELL.BAD and CELL.SATURATION
     31            pmCellSetWeights(cell);
     32
     33            // I have a valid mask, now mask in the analysis region of interest
     34            pmCellSetMask (cell, recipe);
    3035
    3136            // process each of the readouts
    32             while ((readout = pmReadoutNext (fpi)) != NULL) {
    33                 pmFileIOChecks (fpi);
     37            while ((readout = pmReadoutNext (view, input)) != NULL) {
     38                pmFPAfileReadChecks (config->files, view);
    3439               
     40                // run a single-model test if desired
     41                // XXX move this to psphotReadout??
     42                // psphotModelTest (readout, recipe);
     43
    3544                // run the actual photometry analysis
    36                 psphotReadout (readout, config);
     45                psphotReadout (config, view);
     46
     47                pmFPAfileWriteChecks (config->files, view);
    3748
    3849                // write out the desired output dataset(s)
    39                 psphotOutput (readout, config);
     50                // psphotOutput (view, recipe);
    4051            }
     52            pmFPAfileWriteChecks (config->files, view);
    4153        }
     54        pmFPAfileWriteChecks (config->files, view);
    4255    }
    43     pmFileClose (fpi);
     56    pmFPAfileWriteChecks (config->files, view);
    4457    return true;
    4558}
     59
     60// I/O files related to psphot:
     61// PSPHOT.INPUT   : input image file(s)
     62// PSPHOT.RESID   : residual image
     63// PSPHOT.OUTPUT  : output object tables (object)
     64
     65// PSPHOT.BACKSUB : background subtracted image
     66// PSPHOT.BACKGND : background model (full-scale image?)
     67// PSPHOT.BACKMDL : background model (binned image?)
     68// PSPHOT.PSF     : sample PSF images
     69
     70
     71/**
     72
     73filename | pmFPAfile  | pmFPA  | pmFPAview
     74chip00.f | PSPHOT.IN  | input  | view
     75chip01.f | PSPHOT.IN  | input  | view
     76chip02.f | PSPHOT.IN  | input  | view
     77chip03.f | PSPHOT.IN  | input  | view
     78
     79out00.f  | PSPHOT.OUT | input  | view
     80out01.f  | PSPHOT.OUT | input  | view
     81out02.f  | PSPHOT.OUT | input  | view
     82out03.f  | PSPHOT.OUT | input  | view
     83
     84obj00.f  | PSPHOT.OBJ | input  | view
     85obj01.f  | PSPHOT.OBJ | input  | view
     86obj02.f  | PSPHOT.OBJ | input  | view
     87obj03.f  | PSPHOT.OBJ | input  | view
     88
     89bin00.f  | PSPHOT.BIN | binned | view
     90bin01.f  | PSPHOT.BIN | binned | view
     91bin02.f  | PSPHOT.BIN | binned | view
     92bin03.f  | PSPHOT.BIN | binned | view
     93
     94mosaic.f | PSPHOT.MOS | mosaic | view
     95
     96**/
Note: See TracChangeset for help on using the changeset viewer.