Index: /trunk/Ohana/src/relphot/include/relphot.h
===================================================================
--- /trunk/Ohana/src/relphot/include/relphot.h	(revision 27585)
+++ /trunk/Ohana/src/relphot/include/relphot.h	(revision 27586)
@@ -52,4 +52,5 @@
 
 int    VERBOSE;
+int    VERBOSE2;
 int    MOSAIC_ZEROPT;
 
@@ -84,4 +85,6 @@
 int            PhotNsec;
 int            PhotSec;
+
+PhotCode      *refPhotcode;
 
 int AreaSelect;
Index: /trunk/Ohana/src/relphot/src/ImageOps.c
===================================================================
--- /trunk/Ohana/src/relphot/src/ImageOps.c	(revision 27585)
+++ /trunk/Ohana/src/relphot/src/ImageOps.c	(revision 27586)
@@ -193,6 +193,6 @@
   idx = getImageByID (ID);
   if (idx == -1) {
-    fprintf (stderr, "can't match detection to image?\n");
-    abort();
+    if (VERBOSE2) fprintf (stderr, "can't match detection to image?\n");
+    return;
   }
 
@@ -200,6 +200,6 @@
     status = findCCD (idx, meas, cat, measure);
     if (!status) {
-      fprintf (stderr, "failed to determine CCD for %lld, %d\n", (long long) meas, cat);
-      abort();
+      if (VERBOSE2) fprintf (stderr, "failed to determine CCD for %lld, %d\n", (long long) meas, cat);
+      return;
     }
   }
Index: /trunk/Ohana/src/relphot/src/StarOps.c
===================================================================
--- /trunk/Ohana/src/relphot/src/StarOps.c	(revision 27585)
+++ /trunk/Ohana/src/relphot/src/StarOps.c	(revision 27586)
@@ -84,4 +84,11 @@
 	list[N] = Msys - Mcal - Mmos - Mgrid;
 	dlist[N] = MAX (catalog[i].measure[m].dM, MIN_ERROR);
+
+	if (refPhotcode) {
+	  if (GetPhotcodeEquivCodebyCode(catalog[i].measure[m].photcode) == refPhotcode[0].equiv) {
+	    // increase the weight by a factor of 100:
+	    dlist[N] = 0.01*catalog[i].measure[m].dM;
+	  }
+	}
 	N++;
       }
Index: /trunk/Ohana/src/relphot/src/args.c
===================================================================
--- /trunk/Ohana/src/relphot/src/args.c	(revision 27585)
+++ /trunk/Ohana/src/relphot/src/args.c	(revision 27586)
@@ -53,7 +53,11 @@
   }
 
-  VERBOSE = FALSE;
+  VERBOSE = VERBOSE2 = FALSE;
   if ((N = get_argument (argc, argv, "-v"))) {
     VERBOSE = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+  if ((N = get_argument (argc, argv, "-vv"))) {
+    VERBOSE2 = VERBOSE = TRUE;
     remove_argument (N, &argc, argv);
   }
@@ -205,4 +209,15 @@
   }
 
+  refPhotcode = NULL;
+  if ((N = get_argument (argc, argv, "-refcode"))) {
+    remove_argument (N, &argc, argv);
+    refPhotcode = GetPhotcodebyName (argv[N]);
+    if (!refPhotcode) {
+      fprintf (stderr, "ERROR: photcode %s not found in photcode table\n", argv[N]);
+      exit (1);
+    }
+    remove_argument (N, &argc, argv);
+  }
+
   UpdateAverages = FALSE;
   if ((N = get_argument (argc, argv, "-averages"))) {
@@ -224,9 +239,11 @@
   fprintf (stderr, "  options: \n");
   fprintf (stderr, "  -time (start) (stop)\n");
-  fprintf (stderr, "  -v\n");
+  fprintf (stderr, "  -v : verbose output\n");
+  fprintf (stderr, "  -vv : more verbose output\n");
   fprintf (stderr, "  -outroot (outroot)\n");
   fprintf (stderr, "  -plot\n");
   fprintf (stderr, "  -plotdelay (seconds)\n");
   fprintf (stderr, "  -statmode (mode)\n");
+  fprintf (stderr, "  -refcode (name) : give extra weight to this photcode\n");
   fprintf (stderr, "  -n (nloop)\n");
   fprintf (stderr, "  -reset\n");
