IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 11, 2007, 2:01:11 PM (19 years ago)
Author:
eugene
Message:

moved psphot and psastro file defines to ppImageParseCamera, using new
psphotDefineFiles,psastroDefineFiles funcions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppImage/src/ppImageParseCamera.c

    r12746 r12807  
    55# include "ppImage.h"
    66
    7 // XXX clean up error checks: return NULL, not psAbort
    87ppImageOptions *ppImageParseCamera (pmConfig *config) {
    98
     
    1716    }
    1817
    19 #if 0
    20     // the input image defines the camera, and all recipes and options the follow
    21     pmFPAfile *inputMask = pmFPAfileDefineFromArgs (&status, config, "PPIMAGE.INPUT.MASK", "INPUT.MASK");
    22     if (!status || !inputMask) {
    23         psError(PS_ERR_IO, false, "Failed to build FPA from PPIMAGE.INPUT.MASK");
    24         return NULL;
    25     }
    26 
    27     // the input image defines the camera, and all recipes and options the follow
    28     pmFPAfile *inputWeight = pmFPAfileDefineFromArgs (&status, config, "PPIMAGE.INPUT.WEIGHT", "INPUT.WEIGHT");
    29     if (!status || !inputWeight) {
    30         psError(PS_ERR_IO, false, "Failed to build FPA from PPIMAGE.INPUT.WEIGHT");
    31         return NULL;
    32     }
    33 #endif
     18    // if MASK or WEIGHT was supplied on command line, bind files to 'input'
     19    // the mask and weight will be mosaicked with the image
     20    pmFPAfileBindFromArgs (NULL, input, config, "PPIMAGE.INPUT.MASK",   "MASK");
     21    pmFPAfileBindFromArgs (NULL, input, config, "PPIMAGE.INPUT.WEIGHT", "WEIGHT");
    3422
    3523    // add recipe options supplied on command line
     
    189177        psFree(options);
    190178        return NULL;
     179    }
     180
     181    // For photometry, we operate on the chip-mosaicked image
     182    if (options->doPhotom) {
     183        pmFPAfile *psphotInput = pmFPAfileDefineInput (config, byChip->fpa, "PSPHOT.INPUT");
     184        PS_ASSERT (psphotInput, false);
     185        psphotInput->mode = PM_FPA_MODE_REFERENCE;
     186
     187        // define associated psphot input/output files
     188        if (!psphotDefineFiles (config, psphotInput)) {
     189            psError(PSPHOT_ERR_CONFIG, false, "Trouble defining the additional input/output files for psphot");
     190            return false;
     191        }
     192    }
     193
     194    // For photometry, we operate on the chip-mosaicked image
     195    if (options->doAstromChip || options->doAstromMosaic) {
     196        if (!options->doPhotom) {
     197            psError (PSASTRO_ERR_CONFIG, false, "photometry mode is not selected; it is required for astrometry");
     198            return false;
     199        }
     200
     201        pmFPAfile *psphotOutput = psMetadataLookupPtr (&status, config->files, "PSPHOT.OUTPUT");
     202        PS_ASSERT (psphotOutput, false);
     203
     204        pmFPAfile *psastroInput = pmFPAfileDefineInput (config, psphotOutput->fpa, "PSASTRO.INPUT");
     205        PS_ASSERT (psastroInput, false);
     206        psastroInput->mode = PM_FPA_MODE_REFERENCE;
     207
     208        // define associated psphot input/output files
     209        if (!psastroDefineFiles (config, psastroInput)) {
     210            psError(PSPHOT_ERR_CONFIG, false, "Trouble defining the additional input/output files for psastro");
     211            return false;
     212        }
    191213    }
    192214
     
    265287    }
    266288
    267 #if 0
    268     // Get a look inside all the files.
    269     psMetadataIterator *filesIter = psMetadataIteratorAlloc(config->files, PS_LIST_HEAD, NULL); // Iterator
    270     psMetadataItem *item;               // Item from iteration
    271     fprintf(stderr, "Files:\n");
    272     while ((item = psMetadataGetAndIncrement(filesIter))) {
    273         pmFPAfile *file = item->data.V; // File of interest
    274         fprintf(stderr, "%s: %p %p %p (%p) %p\n", file->name,
    275                 file->src, file->fpa,
    276                 file->camera, file->fpa->camera, file->format);
    277     }
    278     psFree(filesIter);
    279 #endif
     289    if (psTraceGetLevel("ppImage.config") > 0) {
     290        // Get a look inside all the files.
     291        psMetadataIterator *filesIter = psMetadataIteratorAlloc(config->files, PS_LIST_HEAD, NULL); // Iterator
     292        psMetadataItem *item;               // Item from iteration
     293        fprintf(stderr, "Files:\n");
     294        while ((item = psMetadataGetAndIncrement(filesIter))) {
     295            pmFPAfile *file = item->data.V; // File of interest
     296            fprintf(stderr, "%s: %p %p %p (%p) %p\n", file->name,
     297                    file->src, file->fpa,
     298                    file->camera, file->fpa->camera, file->format);
     299        }
     300        psFree(filesIter);
     301    }
    280302
    281303    return (options);
Note: See TracChangeset for help on using the changeset viewer.