Changeset 20817 for trunk/magic/remove/src
- Timestamp:
- Nov 21, 2008, 1:41:35 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/magic/remove/src/streaksremove.c (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/magic/remove/src/streaksremove.c
r20816 r20817 187 187 } 188 188 189 static void usage() 190 { 191 fprintf(stderr, "USAGE: streaksremove -stage raw|chip|warp|diff -image IMAGE.fits -tmproot directory -streaks streaks_file\n\n"); 192 fprintf(stderr, "Optional arguments:\n"); 193 fprintf(stderr, "\t-class_id class_id: class_id (required for raw and chip stages)\n"); 194 fprintf(stderr, "\t-recovery: directory to save excised pixel images\n"); 195 fprintf(stderr, "\t-mask MASK.fits mask file to de-streak\n"); 196 fprintf(stderr, "\t-weight WEIGHT.fits: weight file to de-streak\n"); 197 fprintf(stderr, "\t-replace: replace the input images with the output\n"); 198 fprintf(stderr, "\t-remove: remove the original image after processing (requires -replace)\n"); 199 fprintf(stderr, "\t-keepnonwarped: do not exise pixels that were not part of difference processing\n"); 200 fprintf(stderr, "\t-transparent val: instead of setting exicsed pixel to NAN add val\n"); 201 202 exit(2); 203 204 205 } 189 206 static pmConfig *parseArguments(int argc, char **argv) 190 207 { … … 205 222 } else { 206 223 psError(PS_ERR_UNKNOWN, true, "-stage is required\n"); 207 return NULL;224 usage(); 208 225 } 209 226 … … 215 232 } else if ((stage == IPP_STAGE_RAW) || (stage == IPP_STAGE_CHIP)) { 216 233 psError(PS_ERR_UNKNOWN, true, "-class_id is required\n"); 217 return NULL;234 usage(); 218 235 } 219 236 … … 225 242 } else { 226 243 psError(PS_ERR_UNKNOWN, true, "-streaks is required\n"); 227 return NULL;244 usage(); 228 245 } 229 246 … … 244 261 if (!pmConfigFileSetsMD(config->arguments, &argc, argv, "INPUT", "-image", NULL)) { ; 245 262 psError(PS_ERR_UNKNOWN, false, "failed to process -image"); 246 return NULL;263 usage(); 247 264 } 248 265 } 249 266 } else { 250 267 psError(PS_ERR_UNKNOWN, true, "-image is required\n"); 251 return NULL;268 usage(); 252 269 } 253 270 … … 269 286 if (gotReplace) { 270 287 psError(PS_ERR_UNKNOWN, true, "cannot make transparent streaks if -replace"); 271 return NULL;288 usage(); 272 289 } 273 290 psArgumentRemove(argnum, &argc, argv); … … 284 301 if (CHIP_LEVEL_INPUT(stage)) { 285 302 psError(PS_ERR_UNKNOWN, true, "-astrom is required for raw and chip stages\n"); 286 return NULL;303 usage(); 287 304 } 288 305 } … … 294 311 psError(PS_ERR_UNKNOWN, true, "mask image must be %snebulous path with %s image path\n", 295 312 nebulousImage ? "" : "non ", nebulousImage ? "nebulous" : "regular"); 296 return NULL;313 usage(); 297 314 } 298 315 psMetadataAddStr(config->arguments, PS_LIST_TAIL, "INPUT.MASK", 0, … … 307 324 psError(PS_ERR_UNKNOWN, true, "weight image must have %snebulous path with %s image path\n", 308 325 nebulousImage ? "" : "non ", nebulousImage ? "nebulous" : "regular"); 309 return NULL;326 usage(); 310 327 } 311 328 psMetadataAddStr(config->arguments, PS_LIST_TAIL, "INPUT.WEIGHT", 0, … … 320 337 psError(PS_ERR_UNKNOWN, true, "tmproot must have %snebulous path with %s image path with -replace\n", 321 338 nebulousImage ? "" : "non ", nebulousImage ? "nebulous" : "regular"); 322 return NULL;339 usage(); 323 340 } 324 341 psString dir = pathToDirectory(argv[argnum]); … … 328 345 } else { 329 346 psError(PS_ERR_UNKNOWN, true, "-tmproot is required\n"); 330 return NULL;347 usage(); 331 348 } 332 349 … … 339 356 } else if ((stage == IPP_STAGE_RAW) && gotReplace) { 340 357 psError(PS_ERR_UNKNOWN, true, "-recovery is required for -stage raw with -replace\n"); 341 return NULL;358 usage(); 342 359 } 343 360 … … 345 362 if (!gotReplace) { 346 363 psError(PS_ERR_UNKNOWN, true, "-replace is required with -remove\n"); 347 return NULL;364 usage(); 348 365 } 349 366 psArgumentRemove(argnum, &argc, argv); … … 359 376 psError(PS_ERR_UNKNOWN, true, "unexpected arguments: %s", unexpectedArguments); 360 377 psFree(unexpectedArguments); 361 return NULL;378 usage(); 362 379 } 363 380
Note:
See TracChangeset
for help on using the changeset viewer.
