Index: /branches/eam_branches/ipp-20121130/Ohana/src/uniphot/src/initialize_setposangle.c
===================================================================
--- /branches/eam_branches/ipp-20121130/Ohana/src/uniphot/src/initialize_setposangle.c	(revision 34820)
+++ /branches/eam_branches/ipp-20121130/Ohana/src/uniphot/src/initialize_setposangle.c	(revision 34821)
@@ -6,4 +6,9 @@
     fprintf (stderr, "    -v : verbose mode\n");
     fprintf (stderr, "    -update : actually write results to detections tables\n");
+    fprintf (stderr, "    -parallel : run in parallel mode\n");
+    fprintf (stderr, "    -h     : this help list\n");
+    fprintf (stderr, "    -help  : this help list\n");
+    fprintf (stderr, "    --h    : this help list\n");
+    fprintf (stderr, "    --help : this help list\n");
     fprintf (stderr, "    Note that the dvo db can be specified by -D CATDIR (directory)\n");
     exit (2);
Index: /branches/eam_branches/ipp-20121130/Ohana/src/uniphot/src/update_catalog_setposangle.c
===================================================================
--- /branches/eam_branches/ipp-20121130/Ohana/src/uniphot/src/update_catalog_setposangle.c	(revision 34820)
+++ /branches/eam_branches/ipp-20121130/Ohana/src/uniphot/src/update_catalog_setposangle.c	(revision 34821)
@@ -25,9 +25,10 @@
       Mosaic *mosaic = getMosaicForImage(seq);
       Coords *coords = &image[seq].coords;
+      Coords *mosaicCoords = mosaic ? &mosaic->coords : NULL;
 
       double Xccd = catalog[0].measure[m].Xccd;
       double Yccd = catalog[0].measure[m].Yccd;
       
-      setposangle_local_astrometry (&posAngle, &pltScale, Xccd, Yccd, &mosaic->coords, coords);
+      setposangle_local_astrometry (&posAngle, &pltScale, Xccd, Yccd, mosaicCoords, coords);
 
       catalog[0].measure[m].posangle = ToShortDegrees(posAngle);
@@ -52,11 +53,26 @@
   // calculate the astrometry for the coordinate of interest
   XY_to_LM (&Lx, &Mx, x,       y,       coords);
-  XY_to_LM (&Po, &Qo, Lx,      Mx,      mosaic);
+  if (mosaic) {
+    XY_to_LM (&Po, &Qo, Lx,      Mx,      mosaic);
+  } else {
+    Po = Lx;
+    Qo = Mx;
+  }
 
   XY_to_LM (&Lx, &Mx, x + 1.0, y,       coords);
-  XY_to_LM (&Px, &Qx, Lx,      Mx,      mosaic);
+  if (mosaic) {
+    XY_to_LM (&Px, &Qx, Lx,      Mx,      mosaic);
+  } else {
+    Px = Lx;
+    Qx = Mx;
+  }
 
   XY_to_LM (&Lx, &Mx, x,       y + 1.0, coords);
-  XY_to_LM (&Py, &Qy, Lx,      Mx,      mosaic);
+  if (mosaic) {
+    XY_to_LM (&Py, &Qy, Lx,      Mx,      mosaic);
+  } else {
+    Py = Lx;
+    Qy = Mx;
+  }
 
   // XXX units for the resulting Tangent Plane coordinates??
