IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6824


Ignore:
Timestamp:
Apr 9, 2006, 9:02:46 AM (20 years ago)
Author:
eugene
Message:

working toward pmFPAfiles

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppMerge/src/ppMergeConfig.c

    r5862 r6824  
    11# include "ppMerge.h"
    22
    3 bool ppMergeConfig (ppConfig *config, int argc, char **argv) {
     3static void usage (void) {
     4    fprintf (stderr, "USAGE: ppMerge [-file INPUT.fits] [-list INPUT.txt] OUTPUT\n");
     5    exit (2);
     6}
    47
    5     // Parse the configurations (re-org a la ppImage)
    6     config->site = NULL;            // Site configuration
    7     config->camera = NULL;          // Camera configuration
    8     config->recipe = NULL;          // Recipe configuration
    9     if (! pmConfigRead(&config->site, &config->camera, &config->recipe, &argc, argv, RECIPE)) {
     8pmConfig *ppMergeConfig (int argc, char **argv)
     9{
     10    bool status;
     11
     12    if (argc == 1) usage ();
     13
     14    // load the site-wide configuration information
     15    pmConfig *config = pmConfigRead(&argc, argv);
     16    if (! config) {
    1017        psErrorStackPrint(stderr, "Can't find site configuration!\n");
    1118        exit(EXIT_FAILURE);
     
    1522    config->arguments = psMetadataAlloc(); // The arguments, with default values
    1623
    17     psMetadataAddStr(config->arguments, PS_LIST_TAIL, "-glob",  0, "Load files based on a filename glob (eg, file0??.fits)", "");
    18     psMetadataAddStr(config->arguments, PS_LIST_TAIL, "-text",  0, "Load files from a text list", "");
    19     psMetadataAddStr(config->arguments, PS_LIST_TAIL, "-xml",   0, "Load files from an xml-format file", "");
    20     psMetadataAddS32(config->arguments, PS_LIST_TAIL, "-zero",  0, "Name of the mask image", 0);
    21     psMetadataAddS32(config->arguments, PS_LIST_TAIL, "-scale", 0, "Chip number to process (if positive)", 1);
    22     psMetadataAddS32(config->arguments, PS_LIST_TAIL, "-chip",  0, "Chip number to process (if positive)",-1);
     24    // the input file is a required argument; if not found, we will exit
     25    status = pmConfigFileSetsMD (config->arguments, &argc, argv, "INPUT", "-file", "-list");
     26    if (!status) { usage ();}
    2327
    2428    if (! psArgumentParse(config->arguments, &argc, argv) || argc != 2) {
    25         printf("\nPan-STARRS Phase 2 processing\n\n");
    26         printf("Usage: %s OUTPUT.fits\n\n", argv[0]);
    27         psArgumentHelp(config->arguments);
    28         psFree(config->arguments);
    29         exit(EXIT_FAILURE);
     29        usage ();
    3030    }
    3131
    32     // add the input and output images to the arguments list
    33     psMetadataAddStr (config->arguments, PS_LIST_TAIL, "-output", 0, "Name of the output image", argv[1]);
     32    // Add the input and output images (which remain on the command-line) to the arguments list
     33    psMetadataAddStr(config->arguments, PS_LIST_TAIL, "OUTPUT", 0, "Name of the output image", argv[1]);
    3434
     35    // the input image(s) are required arguments
     36    // the first one defines the camera
     37    status = false;
     38    pmFPAfileFromArgs (&status, config, "PPIMAGE.INPUT", "INPUT");
     39    if (!status) {
     40        psAbort (__func__, "missing INPUT entry");
     41    }
     42
     43# if 0
    3544    // define Database handle, if used
    3645    config->database = pmConfigDB(config->site);
     46# endif
     47
    3748    return true;
    3849}
    3950
    40 /*
    41 
    42   possible invokations:
    43   ppMerge -glob (glob) (output)
    44   ppMerge -text (textfile) (output)
    45   ppMerge -xml (xmlfile) (output)
    46   options:
    47     -zero zero
    48     -scale scale
    49  
    50   - input is (in some form) a list of files to be merged
    51   * each chip / cell may have a different bzero / bscale specified
    52   * a simple glob list implies bzero / bscale are constant for all
    53   * the textfile format consists of: (file) [zero scale]
    54   * the xmlfile format includes zero,scale values for each cell
    55  
     51/* we require all information needed to determine the scaling
     52   to be written in the header.  is this reasonable?
    5653*/
    57 
Note: See TracChangeset for help on using the changeset viewer.