Doxygen Source Code Documentation
edt_checkargv.c File Reference
#include "mrilib.h"
Go to the source code of this file.
Defines | |
#define | CHECK_DONE RETURN(nopt-nopt_in) |
Functions | |
int | EDIT_check_argv (int argc, char *argv[], int nopt, EDIT_options *edopt) |
Define Documentation
|
-------------------------------------------------------------------- Check option # nopt to see if it is a legal dataset editing command. If so, put its value into "edopt" and return the number of options consumed. If not, return 0. An illegal editing option results in a fatal error! -----------------------------------------------------------------------* Definition at line 16 of file edt_checkargv.c. Referenced by EDIT_check_argv(). |
Function Documentation
|
Definition at line 18 of file edt_checkargv.c. References EDIT_options::abss, argc, EDIT_options::blur, CHECK_DONE, EDIT_options::clip_bot, EDIT_options::clip_top, EDIT_options::clip_unscaled, EDIT_options::clust_rmm, EDIT_options::clust_vmul, EDIT_options::dilate, EDIT_options::do_zvol, ECFLAG_AMAX, ECFLAG_MAX, ECFLAG_MEAN, ECFLAG_ORDER, ECFLAG_SAME, ECFLAG_SIZE, ECFLAG_SMAX, EDIT_options::edit_clust, ENTRY, EDIT_options::erode_pv, EXIT, EDIT_options::fake_dxyz, FCFLAG_AMAX, FCFLAG_AVER, FCFLAG_MAX, FCFLAG_MEAN, FCFLAG_NZMEAN, FCFLAG_SMAX, EDIT_options::filter_opt, EDIT_options::filter_rmm, FWHM_TO_SIGMA, EDIT_options::mult, EDIT_options::nfmask, EDIT_options::noneg, RETURN, RMS_TO_SIGMA, EDIT_options::scale, strtod(), EDIT_options::thrblur, EDIT_options::thresh, EDIT_options::thrfilter_opt, EDIT_options::thrfilter_rmm, EDIT_options::thtoin, EDIT_options::zscore, EDIT_options::zv_x1, EDIT_options::zv_x2, EDIT_options::zv_y1, EDIT_options::zv_y2, EDIT_options::zv_z1, and EDIT_options::zv_z2. Referenced by CL_read_opts(), HI_read_opts(), main(), MRG_read_opts(), and TT_read_opts().
00019 { 00020 float val ; 00021 int ival , nopt_in=nopt ; 00022 00023 ENTRY("EDIT_check_argv") ; 00024 00025 /**** -1clip val ****/ 00026 00027 if( strncmp(argv[nopt],"-1clip" ,6) == 0 || 00028 strncmp(argv[nopt],"-1uclip",6) == 0 ){ 00029 nopt++ ; 00030 if( nopt >= argc ){ 00031 fprintf(stderr,"no argument after %s?\n",argv[nopt-1]) ; 00032 EXIT(1); 00033 } 00034 edopt->clip_top = strtod( argv[nopt++] , NULL ) ; 00035 if( edopt->clip_top <= 0 ){ 00036 fprintf(stderr,"illegal value after %s!\n",argv[nopt-2]) ; 00037 EXIT(1) ; 00038 } 00039 edopt->clip_bot = -edopt->clip_top ; 00040 edopt->clip_unscaled = (strncmp(argv[nopt-2],"-1uclip",6) == 0) ; 00041 CHECK_DONE ; 00042 } 00043 00044 /**** -2clip val1 val2 ****/ 00045 00046 if( strncmp(argv[nopt],"-2clip" ,6) == 0 || 00047 strncmp(argv[nopt],"-2uclip",6) == 0 ){ 00048 nopt++ ; 00049 if( nopt+1 >= argc ){ 00050 fprintf(stderr,"no arguments after %s?\n",argv[nopt-1]) ; 00051 EXIT(1) ; 00052 } 00053 edopt->clip_bot = strtod( argv[nopt++] , NULL ) ; /* bot */ 00054 edopt->clip_top = strtod( argv[nopt++] , NULL ) ; /* top */ 00055 00056 if( edopt->clip_bot >= edopt->clip_top ){ 00057 fprintf(stderr, 00058 "*** %s %f %f is illegal:\n" 00059 "*** first value must be less than second value!\n", 00060 argv[nopt-3] , edopt->clip_bot , edopt->clip_top ) ; 00061 EXIT(1) ; 00062 } 00063 edopt->clip_unscaled = (strncmp(argv[nopt-3],"-2uclip",6) == 0) ; 00064 CHECK_DONE ; 00065 } 00066 00067 /**** -1thtoin ****/ 00068 00069 if( strncmp(argv[nopt],"-1thtoin",6) == 0 ){ 00070 edopt->thtoin = 1 ; 00071 nopt++ ; CHECK_DONE ; 00072 } 00073 00074 /**** -2thtoin ****/ 00075 00076 if( strncmp(argv[nopt],"-2thtoin",6) == 0 ){ 00077 edopt->thtoin = 2 ; 00078 nopt++ ; CHECK_DONE ; 00079 } 00080 00081 /**** -1zscore (17 Sep 1998) ****/ 00082 00083 if( strncmp(argv[nopt],"-1zscore",6) == 0 ){ 00084 edopt->zscore = 1 ; 00085 nopt++ ; CHECK_DONE ; 00086 } 00087 00088 /**** -dxyz=1 (11 Sep 2000) ****/ 00089 00090 if( strcmp(argv[nopt],"-dxyz=1") == 0 ){ 00091 edopt->fake_dxyz = 1 ; 00092 nopt++ ; CHECK_DONE ; 00093 } 00094 00095 /**** -1noneg ****/ 00096 00097 if( strncmp(argv[nopt],"-1noneg",6) == 0 ){ 00098 edopt->noneg = 1 ; 00099 nopt++ ; CHECK_DONE ; 00100 } 00101 00102 /**** -1abs ****/ 00103 00104 if( strncmp(argv[nopt],"-1abs",6) == 0 ){ 00105 edopt->abss = 1 ; 00106 nopt++ ; CHECK_DONE ; 00107 } 00108 00109 /**** -1thresh thr ****/ 00110 00111 if( strncmp(argv[nopt],"-1thresh",6) == 0 ){ 00112 nopt++ ; 00113 if( nopt >= argc ){ 00114 fprintf(stderr,"no argument after -1thresh!\n") ; 00115 EXIT(1); 00116 } 00117 val = strtod( argv[nopt++] , NULL ) ; 00118 if( val < 0.0 ){ 00119 fprintf(stderr,"illegal value after -1thresh!\n") ; 00120 EXIT(1) ; 00121 } 00122 edopt->thresh = val ; 00123 CHECK_DONE ; 00124 } 00125 00126 /**** -1clust rmm vmul ****/ 00127 00128 if( strncmp(argv[nopt],"-1clust",12) == 0 ){ 00129 nopt++ ; 00130 if( nopt+1 >= argc ){ 00131 fprintf(stderr,"need 2 arguments after -1clust!\n") ; 00132 EXIT(1) ; 00133 } 00134 edopt->edit_clust = ECFLAG_SAME; 00135 edopt->clust_rmm = strtod( argv[nopt++] , NULL ) ; 00136 edopt->clust_vmul = strtod( argv[nopt++] , NULL ) ; 00137 if( edopt->clust_rmm < 0 ){ 00138 fprintf(stderr,"illegal value after -1clust\n") ; 00139 EXIT(1) ; 00140 } 00141 CHECK_DONE ; 00142 } 00143 00144 00145 /**** -1clust_mean rmm vmul ****/ /* 10 Sept 1996 */ 00146 00147 if( strncmp(argv[nopt],"-1clust_mean",12) == 0 ){ 00148 nopt++ ; 00149 if( nopt+1 >= argc ){ 00150 fprintf(stderr,"need 2 arguments after -1clust_mean!\n") ; 00151 EXIT(1) ; 00152 } 00153 edopt->edit_clust = ECFLAG_MEAN; 00154 edopt->clust_rmm = strtod( argv[nopt++] , NULL ) ; 00155 edopt->clust_vmul = strtod( argv[nopt++] , NULL ) ; 00156 if( edopt->clust_rmm < 0 ){ 00157 fprintf(stderr,"illegal value after -1clust_mean\n") ; 00158 EXIT(1) ; 00159 } 00160 CHECK_DONE ; 00161 } 00162 00163 /**** -1clust_max rmm vmul ****/ /* 10 Sept 1996 */ 00164 00165 if( strncmp(argv[nopt],"-1clust_max",12) == 0 ){ 00166 nopt++ ; 00167 if( nopt+1 >= argc ){ 00168 fprintf(stderr,"need 2 arguments after -1clust_max!\n") ; 00169 EXIT(1) ; 00170 } 00171 edopt->edit_clust = ECFLAG_MAX; 00172 edopt->clust_rmm = strtod( argv[nopt++] , NULL ) ; 00173 edopt->clust_vmul = strtod( argv[nopt++] , NULL ) ; 00174 if( edopt->clust_rmm < 0 ){ 00175 fprintf(stderr,"illegal value after -1clust_max\n") ; 00176 EXIT(1) ; 00177 } 00178 CHECK_DONE ; 00179 } 00180 00181 /**** -1clust_amax rmm vmul ****/ /* 10 Sept 1996 */ 00182 00183 if( strncmp(argv[nopt],"-1clust_amax",12) == 0 ){ 00184 nopt++ ; 00185 if( nopt+1 >= argc ){ 00186 fprintf(stderr,"need 2 arguments after -1clust_amax!\n") ; 00187 EXIT(1) ; 00188 } 00189 edopt->edit_clust = ECFLAG_AMAX; 00190 edopt->clust_rmm = strtod( argv[nopt++] , NULL ) ; 00191 edopt->clust_vmul = strtod( argv[nopt++] , NULL ) ; 00192 if( edopt->clust_rmm < 0 ){ 00193 fprintf(stderr,"illegal value after -1clust_amax\n") ; 00194 EXIT(1) ; 00195 } 00196 CHECK_DONE ; 00197 } 00198 00199 /**** -1clust_smax rmm vmul ****/ /* 10 Sept 1996 */ 00200 00201 if( strncmp(argv[nopt],"-1clust_smax",12) == 0 ){ 00202 nopt++ ; 00203 if( nopt+1 >= argc ){ 00204 fprintf(stderr,"need 2 arguments after -1clust_smax!\n") ; 00205 EXIT(1) ; 00206 } 00207 edopt->edit_clust = ECFLAG_SMAX; 00208 edopt->clust_rmm = strtod( argv[nopt++] , NULL ) ; 00209 edopt->clust_vmul = strtod( argv[nopt++] , NULL ) ; 00210 if( edopt->clust_rmm < 0 ){ 00211 fprintf(stderr,"illegal value after -1clust_smax\n") ; 00212 EXIT(1) ; 00213 } 00214 CHECK_DONE ; 00215 } 00216 00217 /**** -1clust_size rmm vmul ****/ /* 10 Sept 1996 */ 00218 00219 if( strncmp(argv[nopt],"-1clust_size",12) == 0 ){ 00220 nopt++ ; 00221 if( nopt+1 >= argc ){ 00222 fprintf(stderr,"need 2 arguments after -1clust_size!\n") ; 00223 EXIT(1) ; 00224 } 00225 edopt->edit_clust = ECFLAG_SIZE; 00226 edopt->clust_rmm = strtod( argv[nopt++] , NULL ) ; 00227 edopt->clust_vmul = strtod( argv[nopt++] , NULL ) ; 00228 if( edopt->clust_rmm < 0 ){ 00229 fprintf(stderr,"illegal value after -1clust_size\n") ; 00230 EXIT(1) ; 00231 } 00232 CHECK_DONE ; 00233 } 00234 00235 /**** -1clust_order rmm vmul ****/ /* 09 June 1998 */ 00236 00237 if( strncmp(argv[nopt],"-1clust_order",12) == 0 ){ 00238 nopt++ ; 00239 if( nopt+1 >= argc ){ 00240 fprintf(stderr,"need 2 arguments after -1clust_order!\n") ; 00241 EXIT(1) ; 00242 } 00243 edopt->edit_clust = ECFLAG_ORDER; 00244 edopt->clust_rmm = strtod( argv[nopt++] , NULL ) ; 00245 edopt->clust_vmul = strtod( argv[nopt++] , NULL ) ; 00246 if( edopt->clust_rmm < 0 ){ 00247 fprintf(stderr,"illegal value after -1clust_order\n") ; 00248 EXIT(1) ; 00249 } 00250 CHECK_DONE ; 00251 } 00252 00253 /**** -1erode pv ****/ /* 17 June 1998 */ 00254 00255 if( strncmp(argv[nopt],"-1erode",7) == 0 ){ 00256 nopt++ ; 00257 if( nopt >= argc ){ 00258 fprintf(stderr,"need 1 argument after -1erode!\n") ; 00259 EXIT(1) ; 00260 } 00261 edopt->erode_pv = strtod( argv[nopt++] , NULL ) ; 00262 if (edopt->erode_pv > 1.0) edopt->erode_pv /= 100.0; 00263 if( edopt->erode_pv < 0.0 || edopt->erode_pv > 1.0 ){ 00264 fprintf(stderr,"illegal value after -1erode \n") ; 00265 EXIT(1) ; 00266 } 00267 CHECK_DONE ; 00268 } 00269 00270 /**** -1dilate ****/ /* 17 June 1998 */ 00271 00272 if( strncmp(argv[nopt],"-1dilate",8) == 0 ){ 00273 nopt++ ; 00274 edopt->dilate = 1; 00275 CHECK_DONE ; 00276 } 00277 00278 /**** -1filter_mean rmm ****/ /* 11 Sept 1996 */ 00279 00280 if( strncmp(argv[nopt],"-1filter_mean",15) == 0 ){ 00281 nopt++ ; 00282 if( nopt >= argc ){ 00283 fprintf(stderr,"need 1 argument after -1filter_mean \n") ; 00284 EXIT(1) ; 00285 } 00286 edopt->filter_opt = FCFLAG_MEAN; 00287 edopt->filter_rmm = strtod( argv[nopt++] , NULL ) ; 00288 if( edopt->filter_rmm <= 0 ){ 00289 fprintf(stderr,"illegal value after -1filter_mean \n") ; 00290 EXIT(1) ; 00291 } 00292 CHECK_DONE ; 00293 } 00294 00295 /**** -1filter_nzmean rmm ****/ /* 11 Sept 1996 */ 00296 00297 if( strncmp(argv[nopt],"-1filter_nzmean",15) == 0 ){ 00298 nopt++ ; 00299 if( nopt >= argc ){ 00300 fprintf(stderr,"need 1 argument after -1filter_nzmean \n") ; 00301 EXIT(1) ; 00302 } 00303 edopt->filter_opt = FCFLAG_NZMEAN; 00304 edopt->filter_rmm = strtod( argv[nopt++] , NULL ) ; 00305 if( edopt->filter_rmm <= 0 ){ 00306 fprintf(stderr,"illegal value after -1filter_nzmean \n") ; 00307 EXIT(1) ; 00308 } 00309 CHECK_DONE ; 00310 } 00311 00312 /**** -1filter_max rmm ****/ /* 11 Sept 1996 */ 00313 00314 if( strncmp(argv[nopt],"-1filter_max",15) == 0 ){ 00315 nopt++ ; 00316 if( nopt >= argc ){ 00317 fprintf(stderr,"need 1 argument after -1filter_max \n") ; 00318 EXIT(1) ; 00319 } 00320 edopt->filter_opt = FCFLAG_MAX; 00321 edopt->filter_rmm = strtod( argv[nopt++] , NULL ) ; 00322 if( edopt->filter_rmm <= 0 ){ 00323 fprintf(stderr,"illegal value after -1filter_max \n") ; 00324 EXIT(1) ; 00325 } 00326 CHECK_DONE ; 00327 } 00328 00329 /**** -1filter_amax rmm ****/ /* 11 Sept 1996 */ 00330 00331 if( strncmp(argv[nopt],"-1filter_amax",15) == 0 ){ 00332 nopt++ ; 00333 if( nopt >= argc ){ 00334 fprintf(stderr,"need 1 argument after -1filter_amax \n") ; 00335 EXIT(1) ; 00336 } 00337 edopt->filter_opt = FCFLAG_AMAX; 00338 edopt->filter_rmm = strtod( argv[nopt++] , NULL ) ; 00339 if( edopt->filter_rmm <= 0 ){ 00340 fprintf(stderr,"illegal value after -1filter_amax \n") ; 00341 EXIT(1) ; 00342 } 00343 CHECK_DONE ; 00344 } 00345 00346 /**** -1filter_smax rmm ****/ /* 11 Sept 1996 */ 00347 00348 if( strncmp(argv[nopt],"-1filter_smax",15) == 0 ){ 00349 nopt++ ; 00350 if( nopt >= argc ){ 00351 fprintf(stderr,"need 1 argument after -1filter_smax \n") ; 00352 EXIT(1) ; 00353 } 00354 edopt->filter_opt = FCFLAG_SMAX; 00355 edopt->filter_rmm = strtod( argv[nopt++] , NULL ) ; 00356 if( edopt->filter_rmm <= 0 ){ 00357 fprintf(stderr,"illegal value after -1filter_smax \n") ; 00358 EXIT(1) ; 00359 } 00360 CHECK_DONE ; 00361 } 00362 00363 /**** -1filter_aver rmm ****/ /* 07 Jan 1998 */ 00364 00365 if( strncmp(argv[nopt],"-1filter_aver",15) == 0 ){ 00366 nopt++ ; 00367 if( nopt >= argc ){ 00368 fprintf(stderr,"need 1 argument after -1filter_aver \n") ; 00369 EXIT(1) ; 00370 } 00371 edopt->filter_opt = FCFLAG_AVER ; 00372 edopt->filter_rmm = strtod( argv[nopt++] , NULL ) ; 00373 if( edopt->filter_rmm <= 0 ){ 00374 fprintf(stderr,"illegal value after -1filter_aver \n") ; 00375 EXIT(1) ; 00376 } 00377 00378 if( edopt->nfmask > 0 ) edopt->filter_opt = FCFLAG_MEAN ; 00379 CHECK_DONE ; 00380 } 00381 00382 00383 /**** -t1filter_aver rmm ****/ /* 07 Jan 1998 */ 00384 00385 if( strncmp(argv[nopt],"-t1filter_aver",15) == 0 ){ 00386 nopt++ ; 00387 if( nopt >= argc ){ 00388 fprintf(stderr,"need 1 argument after -t1filter_aver \n") ; 00389 EXIT(1) ; 00390 } 00391 edopt->thrfilter_opt = FCFLAG_AVER ; 00392 edopt->thrfilter_rmm = strtod( argv[nopt++] , NULL ) ; 00393 if( edopt->thrfilter_rmm <= 0 ){ 00394 fprintf(stderr,"illegal value after -t1filter_aver \n") ; 00395 EXIT(1) ; 00396 } 00397 00398 if( edopt->nfmask > 0 ) edopt->thrfilter_opt = FCFLAG_MEAN ; 00399 CHECK_DONE ; 00400 } 00401 00402 00403 /**** -t1filter_mean rmm ****/ /* 1 Oct 1996 */ 00404 00405 if( strncmp(argv[nopt],"-t1filter_mean",15) == 0 ){ 00406 nopt++ ; 00407 if( nopt >= argc ){ 00408 fprintf(stderr,"need 1 argument after -t1filter_mean \n") ; 00409 EXIT(1) ; 00410 } 00411 edopt->thrfilter_opt = FCFLAG_MEAN; 00412 edopt->thrfilter_rmm = strtod( argv[nopt++] , NULL ) ; 00413 if( edopt->thrfilter_rmm <= 0 ){ 00414 fprintf(stderr,"illegal value after -t1filter_mean \n") ; 00415 EXIT(1) ; 00416 } 00417 CHECK_DONE ; 00418 } 00419 00420 00421 /**** -t1filter_nzmean rmm ****/ /* 1 Oct 1996 */ 00422 00423 if( strncmp(argv[nopt],"-t1filter_nzmean",15) == 0 ){ 00424 nopt++ ; 00425 if( nopt >= argc ){ 00426 fprintf(stderr,"need 1 argument after -t1filter_nzmean \n") ; 00427 EXIT(1) ; 00428 } 00429 edopt->thrfilter_opt = FCFLAG_NZMEAN; 00430 edopt->thrfilter_rmm = strtod( argv[nopt++] , NULL ) ; 00431 if( edopt->thrfilter_rmm <= 0 ){ 00432 fprintf(stderr,"illegal value after -t1filter_nzmean \n") ; 00433 EXIT(1) ; 00434 } 00435 CHECK_DONE ; 00436 } 00437 00438 00439 /**** -t1filter_max rmm ****/ /* 1 Oct 1996 */ 00440 00441 if( strncmp(argv[nopt],"-t1filter_max",15) == 0 ){ 00442 nopt++ ; 00443 if( nopt >= argc ){ 00444 fprintf(stderr,"need 1 argument after -t1filter_max \n") ; 00445 EXIT(1) ; 00446 } 00447 edopt->thrfilter_opt = FCFLAG_MAX; 00448 edopt->thrfilter_rmm = strtod( argv[nopt++] , NULL ) ; 00449 if( edopt->thrfilter_rmm <= 0 ){ 00450 fprintf(stderr,"illegal value after -t1filter_max \n") ; 00451 EXIT(1) ; 00452 } 00453 CHECK_DONE ; 00454 } 00455 00456 00457 /**** -t1filter_amax rmm ****/ /* 1 Oct 1996 */ 00458 00459 if( strncmp(argv[nopt],"-t1filter_amax",15) == 0 ){ 00460 nopt++ ; 00461 if( nopt >= argc ){ 00462 fprintf(stderr,"need 1 argument after -t1filter_amax \n") ; 00463 EXIT(1) ; 00464 } 00465 edopt->thrfilter_opt = FCFLAG_AMAX; 00466 edopt->thrfilter_rmm = strtod( argv[nopt++] , NULL ) ; 00467 if( edopt->thrfilter_rmm <= 0 ){ 00468 fprintf(stderr,"illegal value after -t1filter_amax \n") ; 00469 EXIT(1) ; 00470 } 00471 CHECK_DONE ; 00472 } 00473 00474 00475 /**** -t1filter_smax rmm ****/ /* 1 Oct 1996 */ 00476 00477 if( strncmp(argv[nopt],"-t1filter_smax",15) == 0 ){ 00478 nopt++ ; 00479 if( nopt >= argc ){ 00480 fprintf(stderr,"need 1 argument after -t1filter_smax \n") ; 00481 EXIT(1) ; 00482 } 00483 edopt->thrfilter_opt = FCFLAG_SMAX; 00484 edopt->thrfilter_rmm = strtod( argv[nopt++] , NULL ) ; 00485 if( edopt->thrfilter_rmm <= 0 ){ 00486 fprintf(stderr,"illegal value after -t1filter_smax \n") ; 00487 EXIT(1) ; 00488 } 00489 CHECK_DONE ; 00490 } 00491 00492 00493 00494 00495 /**** -1blur_sigma size ****/ 00496 00497 if( strncmp(argv[nopt],"-1blur_sigma",12) == 0 ){ 00498 nopt++ ; 00499 if( nopt >= argc ){ 00500 fprintf(stderr,"need argument after -1blur_sigma!\n") ; 00501 EXIT(1) ; 00502 } 00503 edopt->blur = strtod( argv[nopt++] , NULL ) ; 00504 if( edopt->blur <= 0 ){ 00505 fprintf(stderr,"illegal value after -1blur_sigma\n") ; 00506 EXIT(1) ; 00507 } 00508 CHECK_DONE ; 00509 } 00510 00511 /**** -1blur_rms size ****/ 00512 00513 if( strncmp(argv[nopt],"-1blur_rms",12) == 0 ){ 00514 nopt++ ; 00515 if( nopt >= argc ){ 00516 fprintf(stderr,"need argument after -1blur_rms!\n") ; 00517 EXIT(1) ; 00518 } 00519 edopt->blur = strtod( argv[nopt++] , NULL ) ; 00520 if( edopt->blur <= 0 ){ 00521 fprintf(stderr,"illegal value after -1blur_rms\n") ; 00522 EXIT(1) ; 00523 } 00524 edopt->blur = RMS_TO_SIGMA(edopt->blur) ; 00525 CHECK_DONE ; 00526 } 00527 00528 /**** -1blur_fwhm size ****/ 00529 00530 if( strncmp(argv[nopt],"-1blur_fwhm",12) == 0 ){ 00531 nopt++ ; 00532 if( nopt >= argc ){ 00533 fprintf(stderr,"need argument after -1blur_fwhm!\n") ; 00534 EXIT(1) ; 00535 } 00536 edopt->blur = strtod( argv[nopt++] , NULL ) ; 00537 if( edopt->blur <= 0 ){ 00538 fprintf(stderr,"illegal value after -1blur_fwhm\n") ; 00539 EXIT(1) ; 00540 } 00541 edopt->blur = FWHM_TO_SIGMA(edopt->blur) ; 00542 CHECK_DONE ; 00543 } 00544 00545 /**** -1blur ****/ 00546 00547 if( strncmp(argv[nopt],"-1blur",6) == 0 ){ 00548 fprintf(stderr, 00549 "*** the old -1blur option is no longer valid! ***\n") ; 00550 EXIT(1) ; 00551 } 00552 00553 /**** -t1blur_sigma size ****/ /* 4 Oct 1996 */ 00554 00555 if( strncmp(argv[nopt],"-t1blur_sigma",12) == 0 ){ 00556 nopt++ ; 00557 if( nopt >= argc ){ 00558 fprintf(stderr,"need argument after -t1blur_sigma!\n") ; 00559 EXIT(1) ; 00560 } 00561 edopt->thrblur = strtod( argv[nopt++] , NULL ) ; 00562 if( edopt->thrblur <= 0 ){ 00563 fprintf(stderr,"illegal value after -t1blur_sigma\n") ; 00564 EXIT(1) ; 00565 } 00566 CHECK_DONE ; 00567 } 00568 00569 /**** -t1blur_rms size ****/ /* 4 Oct 1996 */ 00570 00571 if( strncmp(argv[nopt],"-t1blur_rms",12) == 0 ){ 00572 nopt++ ; 00573 if( nopt >= argc ){ 00574 fprintf(stderr,"need argument after -t1blur_rms!\n") ; 00575 EXIT(1) ; 00576 } 00577 edopt->thrblur = strtod( argv[nopt++] , NULL ) ; 00578 if( edopt->thrblur <= 0 ){ 00579 fprintf(stderr,"illegal value after -t1blur_rms\n") ; 00580 EXIT(1) ; 00581 } 00582 edopt->thrblur = RMS_TO_SIGMA(edopt->thrblur) ; 00583 CHECK_DONE ; 00584 } 00585 00586 /**** -t1blur_fwhm size ****/ /* 4 Oct 1996 */ 00587 00588 if( strncmp(argv[nopt],"-t1blur_fwhm",12) == 0 ){ 00589 nopt++ ; 00590 if( nopt >= argc ){ 00591 fprintf(stderr,"need argument after -t1blur_fwhm!\n") ; 00592 EXIT(1) ; 00593 } 00594 edopt->thrblur = strtod( argv[nopt++] , NULL ) ; 00595 if( edopt->thrblur <= 0 ){ 00596 fprintf(stderr,"illegal value after -t1blur_fwhm\n") ; 00597 EXIT(1) ; 00598 } 00599 edopt->thrblur = FWHM_TO_SIGMA(edopt->thrblur) ; 00600 CHECK_DONE ; 00601 } 00602 00603 00604 /**** -1scale ****/ 00605 00606 if( strncmp(argv[nopt],"-1scale",6) == 0 ){ 00607 #ifdef ALLOW_SCALE_TO_MAX 00608 edopt->scale = 1 ; 00609 #else 00610 fprintf(stderr, 00611 "*** the old -1scale option is no longer valid! ***\n") ; 00612 #endif 00613 nopt++ ; CHECK_DONE ; 00614 } 00615 00616 /**** -1mult mult ****/ 00617 00618 if( strncmp(argv[nopt],"-1mult",6) == 0 ){ 00619 nopt++ ; 00620 if( nopt >= argc ){ 00621 fprintf(stderr,"no argument after -1mult!\n") ; 00622 EXIT(1); 00623 } 00624 val = strtod( argv[nopt++] , NULL ) ; 00625 if( val == 0.0 ){ 00626 fprintf(stderr,"illegal value after -1mult!\n") ; 00627 EXIT(1) ; 00628 } 00629 edopt->mult = val ; 00630 CHECK_DONE ; 00631 } 00632 00633 /**** -1zvol x1 x2 y1 y2 z1 z2 ***/ 00634 00635 if( strncmp(argv[nopt],"-1zvol",6) == 0 ){ 00636 char * cerr ; 00637 00638 if( nopt+6 >= argc ){ 00639 fprintf(stderr,"need 6 arguments after -1zvol!\a\n") ; 00640 EXIT(1) ; 00641 } 00642 00643 edopt->zv_x1 = strtod( argv[nopt+1] , &cerr ) ; 00644 if( cerr == argv[nopt+1] ){ 00645 fprintf(stderr,"illegal 1st argument after -1zvol!\a\n") ; 00646 EXIT(1) ; 00647 } 00648 00649 edopt->zv_x2 = strtod( argv[nopt+2] , &cerr ) ; 00650 if( cerr == argv[nopt+2] ){ 00651 fprintf(stderr,"illegal 2nd argument after -1zvol!\a\n") ; 00652 EXIT(1) ; 00653 } 00654 00655 edopt->zv_y1 = strtod( argv[nopt+3] , &cerr ) ; 00656 if( cerr == argv[nopt+3] ){ 00657 fprintf(stderr,"illegal 3rd argument after -1zvol!\a\n") ; 00658 EXIT(1) ; 00659 } 00660 00661 edopt->zv_y2 = strtod( argv[nopt+4] , &cerr ) ; 00662 if( cerr == argv[nopt+4] ){ 00663 fprintf(stderr,"illegal 4th argument after -1zvol!\a\n") ; 00664 EXIT(1) ; 00665 } 00666 00667 edopt->zv_z1 = strtod( argv[nopt+5] , &cerr ) ; 00668 if( cerr == argv[nopt+5] ){ 00669 fprintf(stderr,"illegal 5th argument after -1zvol!\a\n") ; 00670 EXIT(1) ; 00671 } 00672 00673 edopt->zv_z2 = strtod( argv[nopt+6] , &cerr ) ; 00674 if( cerr == argv[nopt+6] ){ 00675 fprintf(stderr,"illegal 6th argument after -1zvol!\a\n") ; 00676 EXIT(1) ; 00677 } 00678 edopt->do_zvol = 1 ; 00679 00680 nopt += 7 ; CHECK_DONE ; 00681 } 00682 00683 RETURN( 0 ); 00684 } |