Index: trunk/Ohana/src/relastro/src/args.c
===================================================================
--- trunk/Ohana/src/relastro/src/args.c	(revision 17204)
+++ trunk/Ohana/src/relastro/src/args.c	(revision 17205)
@@ -88,8 +88,15 @@
   }
 
-  PHOTCODE_LIST = NULL;
+  PHOTCODE_KEEP_LIST = NULL;
+  if ((N = get_argument (argc, argv, "+photcode"))) {
+    remove_argument (N, &argc, argv);
+    PHOTCODE_KEEP_LIST = strcreate(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  PHOTCODE_SKIP_LIST = NULL;
   if ((N = get_argument (argc, argv, "-photcode"))) {
     remove_argument (N, &argc, argv);
-    PHOTCODE_LIST = strcreate(argv[N]);
+    PHOTCODE_SKIP_LIST = strcreate(argv[N]);
     remove_argument (N, &argc, argv);
   }
@@ -108,4 +115,5 @@
   }
 
+  SAVEPLOT = FALSE;
   PLOTSTUFF = FALSE;
   if ((N = get_argument (argc, argv, "-plot"))) {
@@ -121,5 +129,6 @@
   }
 
-  strcpy (STATMODE, "CHI_INNER_WTMEAN");
+  // by default, require > 10pts to clip
+  strcpy (STATMODE, "CHI_INNER_80_WTMEAN");
   if ((N = get_argument (argc, argv, "-statmode"))) {
     remove_argument (N, &argc, argv);
@@ -193,10 +202,24 @@
   }
   
+  // for now, make the default to ignore the photflags
+  // XXX make it true by default instead?
   PhotFlagSelect = FALSE;
-  if ((N = get_argument (argc, argv, "-photflags"))) {
-    remove_argument (N, &argc, argv);
-    PhotFlagValue = atoi (argv[N]);
+  if ((N = get_argument (argc, argv, "+photflags"))) {
     remove_argument (N, &argc, argv);
     PhotFlagSelect = TRUE;
+  }
+
+  PhotFlagBad = 0;
+  if ((N = get_argument (argc, argv, "-photflagbad"))) {
+    remove_argument (N, &argc, argv);
+    PhotFlagBad = atoi (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  PhotFlagPoor = 0;
+  if ((N = get_argument (argc, argv, "-photflagpoor"))) {
+    remove_argument (N, &argc, argv);
+    PhotFlagPoor = atoi (argv[N]);
+    remove_argument (N, &argc, argv);
   }
 
@@ -225,4 +248,5 @@
   fprintf (stderr, "  -update-mosaics\n");
   fprintf (stderr, "  -time (start)(stop)\n");
+  fprintf (stderr, "  +photcode (code)[,code,code...]\n");
   fprintf (stderr, "  -photcode (code)[,code,code...]\n");
   fprintf (stderr, "  -plot\n");
@@ -237,4 +261,7 @@
   fprintf (stderr, "  -area Xmin Xmax Ymin Ymax\n");
   fprintf (stderr, "  -instmag min max\n\n");
+  fprintf (stderr, "  +photflags\n");
+  fprintf (stderr, "  -photflagbad\n");
+  fprintf (stderr, "  -photflagpoor\n");
   fprintf (stderr, "  -v\n");
   fprintf (stderr, "  \n");
Index: trunk/Ohana/src/relastro/src/select_images.c
===================================================================
--- trunk/Ohana/src/relastro/src/select_images.c	(revision 17204)
+++ trunk/Ohana/src/relastro/src/select_images.c	(revision 17205)
@@ -76,11 +76,20 @@
   for (i = 0; i < Ntimage; i++) {
       
-    /* exclude images by photcode, if selected */
-    if (Nphotcodes > 0) {
+    /* select images by photcode, or equiv photcode, if specified */
+    if (NphotcodesKeep > 0) {
       found = FALSE;
-      for (j = 0; (j < Nphotcodes) && !found; j++) {
-	if (photcodes[j][0].code == timage[i].photcode) found = TRUE;
+      for (k = 0; (k < NphotcodesKeep) && !found; k++) {
+	if (photcodesKeep[k][0].code == timage[i].photcode) found = TRUE;
+	if (photcodesKeep[k][0].code == GetPhotcodeEquivCodebyCode(timage[i].photcode)) found = TRUE;
       }
       if (!found) continue;
+    }
+    if (NphotcodesSkip > 0) {
+      found = FALSE;
+      for (k = 0; (k < NphotcodesSkip) && !found; k++) {
+	if (photcodesSkip[k][0].code == timage[i].photcode) found = TRUE;
+	if (photcodesSkip[k][0].code == GetPhotcodeEquivCodebyCode(timage[i].photcode)) found = TRUE;
+      }
+      if (found) continue;
     }
 
