Index: /trunk/Ohana/src/gastro2/include/gastro2.h
===================================================================
--- /trunk/Ohana/src/gastro2/include/gastro2.h	(revision 7996)
+++ /trunk/Ohana/src/gastro2/include/gastro2.h	(revision 7997)
@@ -126,4 +126,7 @@
 int TEXTMODE;
 int PTOLEMY_FILL_FACTOR;
+int MAGMANUAL;
+double MAGLIM_MIN;
+double MAGLIM_MAX;
 
 int    FORCE;
Index: /trunk/Ohana/src/gastro2/src/gargs.c
===================================================================
--- /trunk/Ohana/src/gastro2/src/gargs.c	(revision 7996)
+++ /trunk/Ohana/src/gastro2/src/gargs.c	(revision 7997)
@@ -70,4 +70,13 @@
     remove_argument (N, argc, argv);
   }
+  if ((N = get_argument (*argc, argv, "-magrange"))) {
+    MAGLIMS = TRUE;
+    MAGMANUAL = TRUE;
+    remove_argument (N, argc, argv);
+    MAGLIM_MIN = atof (argv[N]);
+    remove_argument (N, argc, argv);
+    MAGLIM_MAX = atof (argv[N]);
+    remove_argument (N, argc, argv);
+  }
 
   NMAX_STARS = 300;
Index: /trunk/Ohana/src/gastro2/src/gproject2.c
===================================================================
--- /trunk/Ohana/src/gastro2/src/gproject2.c	(revision 7996)
+++ /trunk/Ohana/src/gastro2/src/gproject2.c	(revision 7997)
@@ -25,12 +25,19 @@
  
   /* need to allow some leeway? use a fixed +/- 0.5 mag for now */
-  MMAX = Target[0].lum.Mmax + 0.5;
-  MMIN = Target[0].lum.Mmin - 0.5;
+  if (MAGLIMS && !MAGMANUAL) {
+      MMAX = Target[0].lum.Mmax + 0.5;
+      MMIN = Target[0].lum.Mmin - 0.5;
 
-  if (MMAX < Ref[0].lum.Mmin + Moff) 
-    fprintf (stderr, "warning: reference catalog probably too faint:  %5.3f < %5.3f\n", Target[0].lum.Mmax, Ref[0].lum.Mmin + Moff);
+      if (MMAX < Ref[0].lum.Mmin + Moff) 
+	  fprintf (stderr, "warning: reference catalog probably too faint:  %5.3f < %5.3f\n", Target[0].lum.Mmax, Ref[0].lum.Mmin + Moff);
 
-  if (MMIN > Ref[0].lum.Mmax + Moff) 
-    fprintf (stderr, "warning: reference catalog probably too bright: %5.3f > %5.3f\n", Target[0].lum.Mmin, Ref[0].lum.Mmax + Moff);
+      if (MMIN > Ref[0].lum.Mmax + Moff) 
+	  fprintf (stderr, "warning: reference catalog probably too bright: %5.3f > %5.3f\n", Target[0].lum.Mmin, Ref[0].lum.Mmax + Moff);
+  }
+  if (MAGMANUAL) {
+      MMIN = MAGLIM_MIN;
+      MMAX = MAGLIM_MAX;
+      Moff = 0;
+  }
 
   for (N = i = 0; i < Ref[0].N; i++) {
Index: /trunk/Ohana/src/gastro2/src/grid.c
===================================================================
--- /trunk/Ohana/src/gastro2/src/grid.c	(revision 7996)
+++ /trunk/Ohana/src/gastro2/src/grid.c	(revision 7997)
@@ -22,4 +22,6 @@
   sr = Ref.stars;
   
+  /* NFIELD represents the search box; it is also the extra padding used 
+     to select the reference stars */
   XMIN = -0.5*NFIELD*Target[0].header.Naxis[0];
   XMAX = +0.5*NFIELD*Target[0].header.Naxis[0];
