Changeset 6824
- Timestamp:
- Apr 9, 2006, 9:02:46 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/ppMerge/src/ppMergeConfig.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppMerge/src/ppMergeConfig.c
r5862 r6824 1 1 # include "ppMerge.h" 2 2 3 bool ppMergeConfig (ppConfig *config, int argc, char **argv) { 3 static void usage (void) { 4 fprintf (stderr, "USAGE: ppMerge [-file INPUT.fits] [-list INPUT.txt] OUTPUT\n"); 5 exit (2); 6 } 4 7 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)) { 8 pmConfig *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) { 10 17 psErrorStackPrint(stderr, "Can't find site configuration!\n"); 11 18 exit(EXIT_FAILURE); … … 15 22 config->arguments = psMetadataAlloc(); // The arguments, with default values 16 23 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 ();} 23 27 24 28 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 (); 30 30 } 31 31 32 // add the input and output imagesto the arguments list33 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]); 34 34 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 35 44 // define Database handle, if used 36 45 config->database = pmConfigDB(config->site); 46 # endif 47 37 48 return true; 38 49 } 39 50 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? 56 53 */ 57
Note:
See TracChangeset
for help on using the changeset viewer.
