Index: /trunk/Ohana/src/opihi/dvo/imrough.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/imrough.c	(revision 2824)
+++ /trunk/Ohana/src/opihi/dvo/imrough.c	(revision 2825)
@@ -5,12 +5,4 @@
 enum {V_NONE, V_EXPTIME, V_CCDN, V_SKY, V_BIAS, V_FILTER, V_FWHM, V_AIRM, V_TIME, V_TEMP0, V_TEMP1, V_TEMP2, V_TEMP3, V_TELFOCUS, V_XPROBE, V_YPROBE, V_ZPROBE, V_RA, V_DEC, V_DETTEMP, V_ROTANGLE, V_REGTIME};
 static char valuename[NVALUE][32] = {"none", "exptime", "ccd", "sky", "bias", "filter", "fwhm", "airmass", "time", "temp0", "temp1", "temp2", "temp3", "telfocus", "xprobe", "yprobe", "zprobe", "ra", "dec", "dettemp", "rotangle", "regtime"};
-
-# define NTYPE 9
-enum {T_NONE, T_OBJECT, T_DARK, T_BIAS, T_FLAT, T_MASK, T_FRINGE, T_SCATTER, T_MODES};
-static char typename[NTYPE][32] = {"none", "object", "dark", "bias", "flat", "mask", "fringe", "scatter", "modes"};
-
-# define NMODE 6
-enum {M_NONE, M_MEG, M_SPLIT, M_SINGLE, M_CUBE, M_SLICE};
-static char modename[NMODE][32] = {"none", "MEF", "SPLIT", "SINGLE", "CUBE", "SLICE"};
 
 imrough (int argc, char **argv) {
@@ -67,13 +59,11 @@
   }
  
-  type = T_NONE;
+  type = T_UNDEF;
   TypeSelect = FALSE;
   if (N = get_argument (argc, argv, "-type")) {
     TypeSelect = TRUE;
     remove_argument (N, &argc, argv);
-    for (i = 0; (i < NTYPE) && (type == T_NONE); i++) {
-      if (!strncasecmp (argv[N], typename[i], strlen(argv[N]))) type = i;
-    }
-    if (type == T_NONE) {
+    type = get_image_type (argv[N]);
+    if (type == T_UNDEF) {
       fprintf (stderr, "ERROR: invalid image type %s\n", argv[N]);
       return (FALSE);
@@ -87,8 +77,6 @@
     ModeSelect = TRUE;
     remove_argument (N, &argc, argv);
-    for (i = 0; (i < NMODE) && (mode == M_NONE); i++) {
-      if (!strncasecmp (argv[N], modename[i], strlen(argv[N]))) mode = i;
-    }
-    if (mode == M_NONE) {
+    mode = get_image_mode (argv[N]);
+    if (mode == M_UNDEF) {
       fprintf (stderr, "ERROR: invalid image mode %s\n", argv[N]);
       return (FALSE);
