Index: branches/eam_branches/ipp-20101103/Ohana/src/photdbc/include/photdbc.h
===================================================================
--- branches/eam_branches/ipp-20101103/Ohana/src/photdbc/include/photdbc.h	(revision 29856)
+++ branches/eam_branches/ipp-20101103/Ohana/src/photdbc/include/photdbc.h	(revision 29857)
@@ -114,2 +114,3 @@
 int SetSignals (void);
 int copy_images (char *outdir);
+void usage();
Index: branches/eam_branches/ipp-20101103/Ohana/src/photdbc/src/args.c
===================================================================
--- branches/eam_branches/ipp-20101103/Ohana/src/photdbc/src/args.c	(revision 29856)
+++ branches/eam_branches/ipp-20101103/Ohana/src/photdbc/src/args.c	(revision 29857)
@@ -61,8 +61,5 @@
   }
 
-  if (argc != 2) {
-    fprintf (stderr, "USAGE: photdbc (output)\n");
-    exit (2);
-  } 
+  if (argc != 2) usage();
 
   if ((REGION.Rmin == 0) && (REGION.Rmax == 360) && (REGION.Dmin == -90) && (REGION.Dmax == +90)) {
@@ -80,23 +77,24 @@
 }
 
-/**
+void usage() {
 
- this program takes an existing DVO database and makes a copy, applying a number of optional
- filters in the process.  
-
- photdbc (output)
-
- allowed filters / restrictions include:
-
- -region ra dec ra dec : limit operation to the specified region 
- -join                 : join measurements between stars using JOIN_RADIUS
- -ccdregion X Y X Y    : only keep detections within the specified detector region
-                         (can this be limited to specific photcodes? cameras? detectors?)
- -photcode_limits code Mmin Mmax : allow multiples of these
-
- SIGMA_MAX
- NMEAS_MIN
- INST_MAG_MAX
- INST_MAG_MIN
-
-**/
+  fprintf (stderr, "USAGE: photdbc (output)\n\n");
+  fprintf (stderr, " this program takes an existing DVO database and makes a copy, applying a number of optional\n");
+  fprintf (stderr, " filters in the process.  \n");
+  fprintf (stderr, "\n");
+  fprintf (stderr, " photdbc (output)\n");
+  fprintf (stderr, "\n");
+  fprintf (stderr, " allowed filters / restrictions include:\n");
+  fprintf (stderr, "\n");
+  fprintf (stderr, " -region Rmin Rmax Dmin Dmax : limit operation to the specified region \n");
+  fprintf (stderr, " -join                 : join measurements between stars using JOIN_RADIUS\n");
+  fprintf (stderr, " -ccdregion X Y X Y    : only keep detections within the specified detector region\n");
+  fprintf (stderr, "                         (can this be limited to specific photcodes? cameras? detectors?)\n");
+  fprintf (stderr, " -photcode_limits code Mmin Mmax : allow multiples of these\n");
+  fprintf (stderr, "\n");
+  fprintf (stderr, " SIGMA_MAX\n");
+  fprintf (stderr, " NMEAS_MIN\n");
+  fprintf (stderr, " INST_MAG_MAX\n");
+  fprintf (stderr, " INST_MAG_MIN\n");
+  exit (2);
+}
Index: branches/eam_branches/ipp-20101103/Ohana/src/photdbc/src/initialize.c
===================================================================
--- branches/eam_branches/ipp-20101103/Ohana/src/photdbc/src/initialize.c	(revision 29856)
+++ branches/eam_branches/ipp-20101103/Ohana/src/photdbc/src/initialize.c	(revision 29857)
@@ -4,4 +4,9 @@
 
   /* are these set correctly? */
+  if (get_argument (argc, argv, "-h")) usage();
+  if (get_argument (argc, argv, "--h")) usage();
+  if (get_argument (argc, argv, "-help")) usage();
+  if (get_argument (argc, argv, "--help")) usage();
+
   ConfigInit (&argc, argv);
   args (argc, argv);
Index: branches/eam_branches/ipp-20101103/Ohana/src/photdbc/src/join_stars.c
===================================================================
--- branches/eam_branches/ipp-20101103/Ohana/src/photdbc/src/join_stars.c	(revision 29856)
+++ branches/eam_branches/ipp-20101103/Ohana/src/photdbc/src/join_stars.c	(revision 29857)
@@ -32,4 +32,5 @@
 
   /* reference for coords is this region */
+  Ncurr = 0;
   Naves = 0;
   Rmid = Dmid = 0;
