Changeset 34886
- Timestamp:
- Jan 5, 2013, 7:07:23 AM (14 years ago)
- Location:
- branches/eam_branches/ipp-20121219/Ohana/src/opihi
- Files:
-
- 2 edited
-
cmd.data/write_vectors.c (modified) (4 diffs)
-
lib.shell/VectorIO.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20121219/Ohana/src/opihi/cmd.data/write_vectors.c
r34584 r34886 10 10 Vector **vec; 11 11 12 if ((N = get_argument (argc, argv, "-h"))) goto usage; 13 if ((N = get_argument (argc, argv, "--h"))) goto usage; 14 if ((N = get_argument (argc, argv, "-help"))) goto usage; 15 if ((N = get_argument (argc, argv, "--help"))) goto usage; 16 12 17 /* look for format option */ 13 18 format = (char *) NULL; … … 17 22 remove_argument (N, &argc, argv); 18 23 } 24 if ((N = get_argument (argc, argv, "-format"))) { 25 if (format) { 26 gprint (GP_ERR, "ERROR: do not mix -f and -format\n"); 27 free (format); 28 return (FALSE); 29 } 30 remove_argument (N, &argc, argv); 31 format = strcreate (argv[N]); 32 remove_argument (N, &argc, argv); 33 } 19 34 20 35 /* option generate a FITS output table */ 21 36 FITS = NULL; 22 37 if ((N = get_argument (argc, argv, "-fits"))) { 23 if (format) {24 gprint (GP_ERR, "ERROR: do not mix -fits and -format\n");25 free (format);26 return (FALSE);27 }28 38 remove_argument (N, &argc, argv); 29 39 FITS = strcreate (argv[N]); … … 61 71 62 72 if (argc < 3) { 63 gprint (GP_ERR, "USAGE: write [-append] [-f \"format\"] file vector vector ...\n"); 73 gprint (GP_ERR, "USAGE: write [options] file vector vector ...\n"); 74 gprint (GP_ERR, "OPTIONS: [-header] [-append] [-f \"format\"] [-fits NAME] [-csv] [-h,--help]\n"); 64 75 return (FALSE); 65 76 } … … 222 233 return (TRUE); 223 234 235 usage: 236 gprint (GP_ERR, "USAGE: write [options] file vector vector ...\n"); 237 gprint (GP_ERR, "OPTIONS: [-header] [-append] [-f \"format\"] [-fits NAME] [-csv] [-h,--help]\n\n"); 238 239 gprint (GP_ERR, "OPTIONS: \n"); 240 gprint (GP_ERR, " -header : add a descriptive header line to ascii or csv output\n"); 241 gprint (GP_ERR, " -append : write to the end of the existing file\n"); 242 gprint (GP_ERR, " -fits NAME : write a fits table (extention name is NAME, column names match vector names)\n"); 243 gprint (GP_ERR, " -csv : write a comma-separated values file (eg, to read in excel)\n"); 244 gprint (GP_ERR, " -f \"format\" : provide formatting codes for output:\n"); 245 gprint (GP_ERR, " ascii / csv : format consists of c-style format codes in form %NN.Md\n"); 246 gprint (GP_ERR, ", the following codes are allowed\n"); 247 gprint (GP_ERR, " %e -- double, %f -- float\n"); 248 gprint (GP_ERR, " %d -- int, %c -- char, %x -- hex int\n"); 249 gprint (GP_ERR, " FITS : format consists of the following FITS binary table format codes:\n"); 250 gprint (GP_ERR, " B : 1 byte int\n"); 251 gprint (GP_ERR, " I : 2 byte int\n"); 252 gprint (GP_ERR, " J : 4 byte int\n"); 253 gprint (GP_ERR, " K : 8 byte int\n"); 254 gprint (GP_ERR, " D : 4 byte float\n"); 255 gprint (GP_ERR, " F : 1 byte float\n"); 256 gprint (GP_ERR, " -h : this help listing\n"); 257 gprint (GP_ERR, " --h : this help listing\n"); 258 gprint (GP_ERR, " -help : this help listing\n"); 259 gprint (GP_ERR, " --help : this help listing\n"); 260 return FALSE; 224 261 } 225 262 -
branches/eam_branches/ipp-20121219/Ohana/src/opihi/lib.shell/VectorIO.c
r34584 r34886 23 23 goto escape; 24 24 } 25 if ((*ptr != 'B') && (*ptr != 'I') && (*ptr != 'J') && (*ptr != ' D') && (*ptr != 'E')) {25 if ((*ptr != 'B') && (*ptr != 'I') && (*ptr != 'J') && (*ptr != 'K') && (*ptr != 'D') && (*ptr != 'E')) { 26 26 gprint (GP_ERR, "error in binary table format %s: invalid character %c\n", format, *ptr); 27 27 goto escape;
Note:
See TracChangeset
for help on using the changeset viewer.
