Changeset 34596 for trunk/pstamp/src/ppstampArguments.c
- Timestamp:
- Oct 25, 2012, 11:37:10 AM (14 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/src/ppstampArguments.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/src/ppstampArguments.c
r33504 r34596 25 25 fprintf(stderr, " [-mask mk_image] : mask image\n"); 26 26 fprintf(stderr, " [-variance var_image] : variance image\n"); 27 fprintf(stderr, " [-sources sources] : sources cmf (ignored for chip stage)\n"); 27 28 fprintf(stderr, " [-stage stage] : stage of input image (raw, chip, warp, stack, diff)\n"); 28 29 fprintf(stderr, " [-write_jpeg] : write a JPEG format of the image stamp\n"); 30 fprintf(stderr, " [-write_cmf] : create an output cmf with the sources overlapping the stamp\n"); 31 fprintf(stderr, " [-wholefile] : ignore the region of interest and process the entire input image\n"); 29 32 // fprintf(stderr, " [-no_censor_masked] : do not set masked pixels to NAN\n"); 30 33 fprintf(stderr, "\n"); … … 92 95 options->stage = psStringCopy(argv[argnum]); 93 96 psArgumentRemove(argnum, &argc, argv); 97 } else { 98 // Should we require this? 99 options->stage = psStringCopy("unknown"); 94 100 } 95 101 if ((argnum = psArgumentGet(argc, argv, "-write_jpeg"))) { 96 102 psArgumentRemove(argnum, &argc, argv); 97 103 options->writeJPEG = true; 98 } else { 99 options->writeJPEG = false; 104 } 105 if ((argnum = psArgumentGet(argc, argv, "-write_cmf"))) { 106 psArgumentRemove(argnum, &argc, argv); 107 options->writeCMF = true; 100 108 } 101 109 102 pmConfigFileSetsMD(config->arguments, &argc, argv, "ASTROM", "-astrom", "-astromlist"); 110 // XXX: Note: the various list options have never been tested with ppstamp to my knowledge 111 bool gotAstrom = false; 112 if ((argnum = psArgumentGet(argc, argv, "-astrom"))) { 113 gotAstrom = true; 114 pmConfigFileSetsMD(config->arguments, &argc, argv, "ASTROM", "-astrom", "-astromlist"); 115 } 103 116 pmConfigFileSetsMD(config->arguments, &argc, argv, "MASK", "-mask", "-masklist"); 104 117 pmConfigFileSetsMD(config->arguments, &argc, argv, "VARIANCE", "-variance", "-variancelist"); 105 118 106 // the input file is a required argument; if not found, we will exit 119 if ((argnum = psArgumentGet(argc, argv, "-sources"))) { 120 pmConfigFileSetsMD(config->arguments, &argc, argv, "SOURCES", "-sources", "-sourceslist"); 121 // supplying a sources file implies that we want to save the output 122 options->writeCMF = true; 123 } else if (options->writeCMF && !gotAstrom) { 124 // if we didn't get a sources file but the user wanted us to write the sources we must 125 // have an astrometry file supplied 126 // XXX: Is this too restrictive? Could the sources be contained in say the input file? 127 psError(PSTAMP_ERR_ARGUMENTS, true, "cannot write cmf file unless input sources are supplied\n"); 128 usage(); 129 } 130 131 // the input image file is a required argument; if not found, we will exit 107 132 bool status = pmConfigFileSetsMD (config->arguments, &argc, argv, "INPUT", "-file", "-list"); 108 133 if (!status) { … … 126 151 } 127 152 128 // finally the o utput file153 // finally the only argument left must be output outroot 129 154 if (argc < 2) { 130 155 psError(PSTAMP_ERR_ARGUMENTS, true, "must specify OUTPUT\n"); … … 135 160 } 136 161 137 // Add the output image (which remains on the command-line) to the arguments list138 162 psMetadataAddStr(config->arguments, PS_LIST_TAIL, "OUTPUT", 0, "Name of the output image", argv[1]); 139 140 // psMetadataPrint(stdout, config->arguments,0);141 163 142 164 return config;
Note:
See TracChangeset
for help on using the changeset viewer.
