Index: /branches/eam_branches/ipp-20131211/Ohana/src/addstar/src/GetFileMode.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/addstar/src/GetFileMode.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/addstar/src/GetFileMode.c	(revision 36398)
@@ -12,5 +12,5 @@
   gfits_scan_alt (header, "SIMPLE", "%t", 1, &simple);
   int haveNaxis = gfits_scan (header, "NAXIS",  "%d", 1, &Naxis);
-  int haveCTYPE = gfits_scan (header, "CTYPE1", "%s", 1, ctype);
+  int haveCTYPE = gfits_scan (header, "CTYPE2", "%s", 1, ctype);
 
   gfits_scan_alt (header, "EXTEND", "%t", 1, &extend);
Index: /branches/eam_branches/ipp-20131211/Ohana/src/addstar/src/LoadDataPMM.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/addstar/src/LoadDataPMM.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/addstar/src/LoadDataPMM.c	(revision 36398)
@@ -193,5 +193,5 @@
 
     // XXX for now, we define a totally fake coordinate system centered on the plate center
-    strcpy (image[0].coords.ctype, "RA---TAN");
+    strcpy (image[0].coords.ctype, "DEC--TAN");
     
     image[0].coords.crval1  = pmm_get_ra (RA);
Index: /branches/eam_branches/ipp-20131211/Ohana/src/addstar/src/ReadStarsSDSS.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/addstar/src/ReadStarsSDSS.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/addstar/src/ReadStarsSDSS.c	(revision 36398)
@@ -201,5 +201,5 @@
     
     // XXX for now, we define a totally fake coordinate system centered on the first listed star
-    strcpy (images[N].coords.ctype, "RA---TAN");
+    strcpy (images[N].coords.ctype, "DEC--TAN");
     
     images[N].coords.crval1 = stars[0].average.R;
Index: /branches/eam_branches/ipp-20131211/Ohana/src/addstar/src/fakeimage.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/addstar/src/fakeimage.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/addstar/src/fakeimage.c	(revision 36398)
@@ -34,5 +34,5 @@
 
   /* create a mosaic distortion structure */
-  strcpy (MOSAIC.ctype, "RA---DIS");
+  strcpy (MOSAIC.ctype, "DEC--DIS");
   MOSAIC.crval1 = FAKE_RA;
   MOSAIC.crval2 = FAKE_DEC;
@@ -86,5 +86,5 @@
     strcpy (image[i+1].name, name);
 
-    strcpy (image[i+1].coords.ctype, "RA---WRP");
+    strcpy (image[i+1].coords.ctype, "DEC--WRP");
     
     image[i+1].coords.crval1 = dX*pixscale;
Index: /branches/eam_branches/ipp-20131211/Ohana/src/addstar/src/find_matches.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/addstar/src/find_matches.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/addstar/src/find_matches.c	(revision 36398)
@@ -65,5 +65,5 @@
   tcoords.pc1_2 = tcoords.pc2_1 = 0.0;
   tcoords.Npolyterms = 1;
-  strcpy (tcoords.ctype, "RA---ARC");
+  strcpy (tcoords.ctype, "DEC--ARC");
 
   /* build spatial index (RA sort) referencing input array sequence */
Index: /branches/eam_branches/ipp-20131211/Ohana/src/addstar/src/find_matches_closest.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/addstar/src/find_matches_closest.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/addstar/src/find_matches_closest.c	(revision 36398)
@@ -64,5 +64,5 @@
   tcoords.pc1_2 = tcoords.pc2_1 = 0.0;
   tcoords.Npolyterms = 1;
-  strcpy (tcoords.ctype, "RA---ARC");
+  strcpy (tcoords.ctype, "DEC--ARC");
 
   /* build spatial index (RA sort) referencing input array sequence */
Index: /branches/eam_branches/ipp-20131211/Ohana/src/addstar/src/find_matches_closest_refstars.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/addstar/src/find_matches_closest_refstars.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/addstar/src/find_matches_closest_refstars.c	(revision 36398)
@@ -59,5 +59,5 @@
   tcoords.pc1_2 = tcoords.pc2_1 = 0.0;
   tcoords.Npolyterms = 0;
-  strcpy (tcoords.ctype, "RA---ARC");
+  strcpy (tcoords.ctype, "DEC--ARC");
   
   /* build spatial index (RA sort) referencing input array sequence */
Index: /branches/eam_branches/ipp-20131211/Ohana/src/addstar/src/find_matches_refstars.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/addstar/src/find_matches_refstars.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/addstar/src/find_matches_refstars.c	(revision 36398)
@@ -57,5 +57,5 @@
   tcoords.pc1_1 = tcoords.pc2_2 = 1.0;
   tcoords.pc1_2 = tcoords.pc2_1 = 0.0;
-  strcpy (tcoords.ctype, "RA---ZEA");
+  strcpy (tcoords.ctype, "DEC--ZEA");
   tcoords.Npolyterms = 0;
   
Index: /branches/eam_branches/ipp-20131211/Ohana/src/addstar/src/loadsupercos_plates.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/addstar/src/loadsupercos_plates.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/addstar/src/loadsupercos_plates.c	(revision 36398)
@@ -118,5 +118,5 @@
 
     // for now, we define a fake coordinate system based on the boresite center
-    strcpy (image[Nimage].coords.ctype, "RA---TAN");
+    strcpy (image[Nimage].coords.ctype, "DEC--TAN");
     
     image[Nimage].coords.crval1 = RAo;
Index: /branches/eam_branches/ipp-20131211/Ohana/src/addstar/src/sky_tessalation.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/addstar/src/sky_tessalation.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/addstar/src/sky_tessalation.c	(revision 36398)
@@ -1106,5 +1106,5 @@
   refcoords[0].Npolyterms = 0;
   memset (refcoords[0].polyterms, 0, 14*sizeof(float));
-  strcpy (refcoords[0].ctype, "RA---TAN");
+  strcpy (refcoords[0].ctype, "DEC--TAN");
   return (TRUE);
 }
Index: /branches/eam_branches/ipp-20131211/Ohana/src/dvomerge/src/merge_catalogs_old.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/dvomerge/src/merge_catalogs_old.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/dvomerge/src/merge_catalogs_old.c	(revision 36398)
@@ -76,5 +76,5 @@
   tcoords.pc1_2 = tcoords.pc2_1 = 0.0;
   tcoords.Npolyterms = 1;
-  strcpy (tcoords.ctype, "RA---ARC");
+  strcpy (tcoords.ctype, "DEC--ARC");
 
   if (VERBOSE) fprintf (stderr, "merging %s into %s\n", input[0].filename, output[0].filename);
Index: /branches/eam_branches/ipp-20131211/Ohana/src/fixcat/src/gcatstats.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/fixcat/src/gcatstats.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/fixcat/src/gcatstats.c	(revision 36398)
@@ -52,5 +52,5 @@
   catstats[0].coords.pc1_1 = catstats[0].coords.pc2_2 = 1.0;
   catstats[0].coords.pc1_2 = catstats[0].coords.pc2_1 = 0.0;
-  strcpy (catstats[0].coords.ctype, "RA---TAN");
+  strcpy (catstats[0].coords.ctype, "DEC--TAN");
 
   X1 = catstats[0].X;
Index: /branches/eam_branches/ipp-20131211/Ohana/src/gastro/src/gstars.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/gastro/src/gstars.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/gastro/src/gstars.c	(revision 36398)
@@ -79,5 +79,5 @@
   if (!strcasecmp (ROUGH_ASTROMETRY, "config")) {
     /* default values for coords */
-    strcpy (coords[0].ctype, "RA---TAN");
+    strcpy (coords[0].ctype, "DEC--TAN");
     coords[0].pc1_1 = CCD_PC1_1; coords[0].pc1_2 = CCD_PC1_2;
     coords[0].pc2_1 = CCD_PC2_1; coords[0].pc2_2 = CCD_PC2_2;
Index: /branches/eam_branches/ipp-20131211/Ohana/src/gastro2/src/coordtest.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/gastro2/src/coordtest.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/gastro2/src/coordtest.c	(revision 36398)
@@ -85,5 +85,5 @@
   fit_eval ();
 
-  strcpy (coords.ctype, "RA---PLY");
+  strcpy (coords.ctype, "DEC--PLY");
   coords.crval1 = 0.0;
   coords.crval2 = 0.0;
Index: /branches/eam_branches/ipp-20131211/Ohana/src/gastro2/src/gstars2.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/gastro2/src/gstars2.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/gastro2/src/gstars2.c	(revision 36398)
@@ -28,5 +28,5 @@
 
   /* default values for coords */
-  strcpy (Target[0].coords.ctype, "RA---TAN");
+  strcpy (Target[0].coords.ctype, "DEC--TAN");
   Target[0].coords.pc1_1 = CCD_PC1_1; Target[0].coords.pc1_2 = CCD_PC1_2;
   Target[0].coords.pc2_1 = CCD_PC2_1; Target[0].coords.pc2_2 = CCD_PC2_2;
Index: /branches/eam_branches/ipp-20131211/Ohana/src/getstar/src/GetFileMode.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/getstar/src/GetFileMode.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/getstar/src/GetFileMode.c	(revision 36398)
@@ -10,5 +10,5 @@
   gfits_scan_alt (header, "SIMPLE", "%t", 1, &simple);
   haveNaxis = gfits_scan (header, "NAXIS",  "%d", 1, &Naxis);
-  haveCTYPE = gfits_scan (header, "CTYPE1", "%s", 1, ctype);
+  haveCTYPE = gfits_scan (header, "CTYPE2", "%s", 1, ctype);
 
   gfits_scan_alt (header, "EXTEND", "%t", 1, &extend);
Index: /branches/eam_branches/ipp-20131211/Ohana/src/getstar/src/MatchImages.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/getstar/src/MatchImages.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/getstar/src/MatchImages.c	(revision 36398)
@@ -36,5 +36,5 @@
     tcoords.pc1_2 = tcoords.pc2_1 = 0.0;
     tcoords.Npolyterms = 1;
-    strcpy (tcoords.ctype, "RA---TAN");
+    strcpy (tcoords.ctype, "DEC--TAN");
     /* register so image->sky conversions below have correct mosaic */
   } else {
@@ -44,5 +44,5 @@
     tcoords.pc1_2 = tcoords.pc2_1 = 0.0;
     tcoords.Npolyterms = 1;
-    strcpy (tcoords.ctype, "RA---TAN");
+    strcpy (tcoords.ctype, "DEC--TAN");
   }
 
Index: /branches/eam_branches/ipp-20131211/Ohana/src/kapa2/src/Graphs.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/kapa2/src/Graphs.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/kapa2/src/Graphs.c	(revision 36398)
@@ -64,5 +64,5 @@
   graph[0].data.coords.crpix2 = 0.0;
   graph[0].data.coords.cdelt1 = graph[0].data.coords.cdelt2 = 1.0;
-  strcpy (graph[0].data.coords.ctype, "RA---LIN");
+  strcpy (graph[0].data.coords.ctype, "DEC--LIN");
   strcpy (graph[0].data.axis, "2222");
   strcpy (graph[0].data.ticks, "2222");
Index: /branches/eam_branches/ipp-20131211/Ohana/src/kapa2/src/Image.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/kapa2/src/Image.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/kapa2/src/Image.c	(revision 36398)
@@ -18,5 +18,5 @@
   channel->coords.crpix2 = 0.0;
   channel->coords.cdelt1 = channel->coords.cdelt2 = 1.0;
-  strcpy (channel->coords.ctype, "RA---LIN");
+  strcpy (channel->coords.ctype, "DEC--LIN");
   channel->coords.Npolyterms = 0;
 
Index: /branches/eam_branches/ipp-20131211/Ohana/src/libdvo/src/ImageMetadataSelection.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/libdvo/src/ImageMetadataSelection.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/libdvo/src/ImageMetadataSelection.c	(revision 36398)
@@ -18,5 +18,5 @@
   field.pc1_2  = field.pc2_1  = 0.0;
   field.Npolyterms = 0;
-  strcpy (field.ctype, "RA---SIN");
+  strcpy (field.ctype, "DEC--SIN");
 
   /* mosaic defines a frame with 0,0 at the mosaic center, and 1 arcsec / pixel */
@@ -26,5 +26,5 @@
   mosaic.pc1_2  = mosaic.pc2_1  = 0.0;
   mosaic.Npolyterms = 0;
-  strcpy (mosaic.ctype, "RA---SIN");
+  strcpy (mosaic.ctype, "DEC--SIN");
 
   if ((image = ImageMetadataLoad (filename, &Nimage)) == NULL) return (FALSE);
Index: /branches/eam_branches/ipp-20131211/Ohana/src/libdvo/src/ImageSelection.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/libdvo/src/ImageSelection.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/libdvo/src/ImageSelection.c	(revision 36398)
@@ -28,5 +28,5 @@
       mosaic.pc1_2  = mosaic.pc2_1  = 0.0;
       mosaic.Npolyterms = 0;
-      strcpy (mosaic.ctype, "RA---SIN");
+      strcpy (mosaic.ctype, "DEC--SIN");
   }
 
Index: /branches/eam_branches/ipp-20131211/Ohana/src/libdvo/src/coordops.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/libdvo/src/coordops.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/libdvo/src/coordops.c	(revision 36398)
@@ -1,3 +1,5 @@
 # include <dvo.h>
+
+/* note that Coords.ctype carries the DEC (ctype2) value */
 
 static Coords mosaic;
@@ -621,4 +623,5 @@
 
   /* modifications to the ctype? */
+  /* note that Coords.ctype carries the DEC (ctype2) value */
   OldAIPS = FALSE;
   gfits_modify (header, "CTYPE2",   "%s",  1, coords[0].ctype);
Index: /branches/eam_branches/ipp-20131211/Ohana/src/libkapa/src/KapaWindow.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/libkapa/src/KapaWindow.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/libkapa/src/KapaWindow.c	(revision 36398)
@@ -100,5 +100,5 @@
   graphdata[0].coords.pc1_1 = graphdata[0].coords.pc2_2 = 1.0;
   graphdata[0].coords.pc1_2 = graphdata[0].coords.pc2_1 = 0.0;
-  strcpy (graphdata[0].coords.ctype, "RA---LIN");
+  strcpy (graphdata[0].coords.ctype, "DEC--LIN");
   graphdata[0].coords.crval1 = 0.0;
   graphdata[0].coords.crval2 = 0.0;
Index: /branches/eam_branches/ipp-20131211/Ohana/src/markrock/src/gcatstats.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/markrock/src/gcatstats.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/markrock/src/gcatstats.c	(revision 36398)
@@ -40,5 +40,5 @@
   catstats[0].coords.pc1_1 = catstats[0].coords.pc2_2 = 1.0;
   catstats[0].coords.pc1_2 = catstats[0].coords.pc2_1 = 0.0;
-  strcpy (catstats[0].coords.ctype, "RA---TAN");
+  strcpy (catstats[0].coords.ctype, "DEC--TAN");
 
   X1 = catstats[0].X;
Index: /branches/eam_branches/ipp-20131211/Ohana/src/markstar/src/gcatstats.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/markstar/src/gcatstats.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/markstar/src/gcatstats.c	(revision 36398)
@@ -50,5 +50,5 @@
   catstats[0].coords.pc1_1 = catstats[0].coords.pc2_2 = 1.0;
   catstats[0].coords.pc1_2 = catstats[0].coords.pc2_1 = 0.0;
-  strcpy (catstats[0].coords.ctype, "RA---TAN");
+  strcpy (catstats[0].coords.ctype, "DEC--TAN");
 
   X1 = catstats[0].X;
Index: /branches/eam_branches/ipp-20131211/Ohana/src/mosastro/src/warptest.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/mosastro/src/warptest.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/mosastro/src/warptest.c	(revision 36398)
@@ -15,5 +15,5 @@
 
   /* bore site center guess */
-  sprintf (coords.ctype, "RA---%s", argv[1]);
+  sprintf (coords.ctype, "DEC--%s", argv[1]);
   coords.crval1 = 0.0;
   coords.crval2 = 0.0;
Index: /branches/eam_branches/ipp-20131211/Ohana/src/opihi/cmd.astro/cdensify.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/opihi/cmd.astro/cdensify.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/opihi/cmd.astro/cdensify.c	(revision 36398)
@@ -76,8 +76,15 @@
   Ny = (Ymax - Ymin) / dY + 1;
   
+  Coords newcoords = graphmode.coords;
+  newcoords.cdelt1 *= dX;
+  newcoords.cdelt2 *= dY;
+  newcoords.crpix1 = (newcoords.crpix1 - Xmin) / dX;
+  newcoords.crpix2 = (newcoords.crpix2 - Ymin) / dY;
+
   gfits_free_matrix (&bf[0].matrix);
   gfits_free_header (&bf[0].header);
   CreateBuffer (bf, Nx, Ny, -32, 0.0, 1.0);
   strcpy (bf[0].file, "(empty)");
+  PutCoords (&newcoords, &bf[0].header);
   
   float scalescale = scale*scale;
@@ -96,5 +103,5 @@
   coords.pc1_2  = coords.pc2_1  = 0.0;
   coords.Npolyterms = 0;
-  strcpy (coords.ctype, "RA---TAN");
+  strcpy (coords.ctype, "DEC--TAN");
 
   r = vr[0].elements.Flt;
@@ -113,4 +120,8 @@
 	Xb = (x - Xmin) / dX;
 	Yb = (y - Ymin) / dY;
+
+	RD_to_XY (&x, &y, rn, *d, &newcoords);
+	Xb = (int) x;
+	Yb = (int) y;
 	if (Xb >= Nx) continue;
 	if (Yb >= Ny) continue;
Index: /branches/eam_branches/ipp-20131211/Ohana/src/opihi/cmd.astro/fitplx.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/opihi/cmd.astro/fitplx.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/opihi/cmd.astro/fitplx.c	(revision 36398)
@@ -112,5 +112,5 @@
   coords.pc1_2  = coords.pc2_1 = 0.0;
   coords.Npolyterms = 1;
-  strcpy (coords.ctype, "RA---SIN");
+  strcpy (coords.ctype, "DEC--SIN");
 
   double *X, *Y, *t, *pX, *pY, *dX, *dY;
Index: /branches/eam_branches/ipp-20131211/Ohana/src/opihi/cmd.astro/region.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/opihi/cmd.astro/region.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/opihi/cmd.astro/region.c	(revision 36398)
@@ -80,22 +80,22 @@
   if (!ohana_str_to_radec (&Ra, &Dec, argv[1], argv[2])) return (FALSE);
   Radius = atof (argv[3]);
-  strcpy (graphmode.coords.ctype, "RA---TAN");
+  strcpy (graphmode.coords.ctype, "DEC--TAN");
   if (argc == 5) {
     if (!strcasecmp (argv[4], "TAN")) 
-      strcpy (graphmode.coords.ctype, "RA---TAN");
+      strcpy (graphmode.coords.ctype, "DEC--TAN");
     if (!strcasecmp (argv[4], "SIN")) 
-      strcpy (graphmode.coords.ctype, "RA---SIN");
+      strcpy (graphmode.coords.ctype, "DEC--SIN");
     if (!strcasecmp (argv[4], "ARC")) 
-      strcpy (graphmode.coords.ctype, "RA---ARC");
+      strcpy (graphmode.coords.ctype, "DEC--ARC");
     if (!strcasecmp (argv[4], "STG")) 
-      strcpy (graphmode.coords.ctype, "RA---STG");
+      strcpy (graphmode.coords.ctype, "DEC--STG");
     if (!strcasecmp (argv[4], "ZEA"))
-      strcpy (graphmode.coords.ctype, "RA---ZEA");
+      strcpy (graphmode.coords.ctype, "DEC--ZEA");
     if (!strcasecmp (argv[4], "AIT")) 
-      strcpy (graphmode.coords.ctype, "RA---AIT");
+      strcpy (graphmode.coords.ctype, "DEC--AIT");
     if (!strcasecmp (argv[4], "GLS")) 
-      strcpy (graphmode.coords.ctype, "RA---GLS");
+      strcpy (graphmode.coords.ctype, "DEC--GLS");
     if (!strcasecmp (argv[4], "PAR")) 
-      strcpy (graphmode.coords.ctype, "RA---PAR");
+      strcpy (graphmode.coords.ctype, "DEC--PAR");
   }
 
Index: /branches/eam_branches/ipp-20131211/Ohana/src/opihi/dvo/find_matches.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/opihi/dvo/find_matches.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/opihi/dvo/find_matches.c	(revision 36398)
@@ -50,5 +50,5 @@
   tcoords.pc1_2 = tcoords.pc2_1 = 0.0;
   tcoords.Npolyterms = 1;
-  strcpy (tcoords.ctype, "RA---ARC");
+  strcpy (tcoords.ctype, "DEC--ARC");
 
   // this region includes a boundary layer of size RADIUS
Index: /branches/eam_branches/ipp-20131211/Ohana/src/opihi/dvo/gimages.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/opihi/dvo/gimages.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/opihi/dvo/gimages.c	(revision 36398)
@@ -136,5 +136,5 @@
       local.pc2_1 = local.pc1_2 = 0.0;
       local.Npolyterms = 1;
-      strcpy (local.ctype, "RA---TAN");
+      strcpy (local.ctype, "DEC--TAN");
 
       if (typehash == DistortImage) {
Index: /branches/eam_branches/ipp-20131211/Ohana/src/opihi/dvo/showtile.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/opihi/dvo/showtile.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/opihi/dvo/showtile.c	(revision 36398)
@@ -34,5 +34,5 @@
   coords.pc1_2  = coords.pc2_1  = 0.0;
   coords.Npolyterms = 0;
-  strcpy (coords.ctype, "RA---TAN");
+  strcpy (coords.ctype, "DEC--TAN");
   
   /* fill in top-left region */
Index: /branches/eam_branches/ipp-20131211/Ohana/src/opihi/dvo/simage.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/opihi/dvo/simage.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/opihi/dvo/simage.c	(revision 36398)
@@ -43,6 +43,6 @@
   /* get astrometry information */
   strcpy (coords.ctype, "NONE");
-  gfits_scan (&header, "CTYPE1",   "%s",  1, coords.ctype);
-  if (strcmp (coords.ctype, "RA---PLY")) {
+  gfits_scan (&header, "CTYPE2",   "%s",  1, coords.ctype);
+  if (strcmp (coords.ctype, "DEC--PLY")) {
     gprint (GP_ERR, "ERROR: wrong astrometric info in header\n");
     return (FALSE);
Index: /branches/eam_branches/ipp-20131211/Ohana/src/photdbc/src/find_images.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/photdbc/src/find_images.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/photdbc/src/find_images.c	(revision 36398)
@@ -25,5 +25,5 @@
   tcoords.pc1_1  = tcoords.pc2_2 = 1.0;
   tcoords.pc1_2  = tcoords.pc2_1 = 0.0;
-  strcpy (tcoords.ctype, "RA---TAN");
+  strcpy (tcoords.ctype, "DEC--TAN");
 
   timage = gfits_table_get_Image (&db[0].ftable, &Ntimage, &db[0].swapped);
Index: /branches/eam_branches/ipp-20131211/Ohana/src/photdbc/src/join_stars.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/photdbc/src/join_stars.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/photdbc/src/join_stars.c	(revision 36398)
@@ -57,5 +57,5 @@
   tcoords.pc1_2  = tcoords.pc2_1 = 0.0;
   tcoords.Npolyterms = 0;
-  strcpy (tcoords.ctype, "RA---TAN");
+  strcpy (tcoords.ctype, "DEC--TAN");
   
   /* project & sort coordinates in local linear frame */
Index: /branches/eam_branches/ipp-20131211/Ohana/src/relastro/src/UpdateObjects.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/relastro/src/UpdateObjects.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/relastro/src/UpdateObjects.c	(revision 36398)
@@ -67,5 +67,5 @@
   coords.pc1_2  = coords.pc2_1 = 0.0;
   coords.Npolyterms = 1;
-  strcpy (coords.ctype, "RA---SIN");
+  strcpy (coords.ctype, "DEC--SIN");
 
   XVERB = FALSE;
Index: /branches/eam_branches/ipp-20131211/Ohana/src/relastro/src/high_speed_objects.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/relastro/src/high_speed_objects.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/relastro/src/high_speed_objects.c	(revision 36398)
@@ -161,5 +161,5 @@
   tcoords.pc1_2 = tcoords.pc2_1 = 0.0;
   tcoords.Npolyterms = 1;
-  strcpy (tcoords.ctype, "RA---ARC");
+  strcpy (tcoords.ctype, "DEC--ARC");
 
   /* build spatial index (RA sort) referencing input array sequence */
Index: /branches/eam_branches/ipp-20131211/Ohana/src/relastro/src/hpm_objects.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/relastro/src/hpm_objects.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/relastro/src/hpm_objects.c	(revision 36398)
@@ -138,5 +138,5 @@
   tcoords.pc1_2 = tcoords.pc2_1 = 0.0;
   tcoords.Npolyterms = 1;
-  strcpy (tcoords.ctype, "RA---ARC");
+  strcpy (tcoords.ctype, "DEC--ARC");
 
   /* build spatial index (RA sort) referencing input array sequence */
Index: /branches/eam_branches/ipp-20131211/Ohana/src/relastro/src/select_images.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/relastro/src/select_images.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/relastro/src/select_images.c	(revision 36398)
@@ -57,5 +57,5 @@
   tcoords.pc1_1  = tcoords.pc2_2 = 1.0;
   tcoords.pc1_2  = tcoords.pc2_1 = 0.0;
-  strcpy (tcoords.ctype, "RA---TAN");
+  strcpy (tcoords.ctype, "DEC--TAN");
 
   ALLOCATE (skycoords, SkyRegionCoords, skylist[0].Nregions);
Index: /branches/eam_branches/ipp-20131211/Ohana/src/relastro/src/testparallax.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/relastro/src/testparallax.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/relastro/src/testparallax.c	(revision 36398)
@@ -57,5 +57,5 @@
   coords.pc1_2  = coords.pc2_1 = 0.0;
   coords.Npolyterms = 1;
-  strcpy (coords.ctype, "RA---SIN");
+  strcpy (coords.ctype, "DEC--SIN");
 
   // use one point as a local reference
Index: /branches/eam_branches/ipp-20131211/Ohana/src/relphot/src/MosaicOps.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/relphot/src/MosaicOps.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/relphot/src/MosaicOps.c	(revision 36398)
@@ -412,5 +412,5 @@
     }
     dS /= MosaicN_Image[i];
-    strcpy (mosaic[i].coords.ctype, "RA---TAN");
+    strcpy (mosaic[i].coords.ctype, "DEC--TAN");
     mosaic[i].coords.crval1 = Rmin;
     mosaic[i].coords.crval2 = Dmin;
Index: /branches/eam_branches/ipp-20131211/Ohana/src/relphot/src/select_images.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/relphot/src/select_images.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/relphot/src/select_images.c	(revision 36398)
@@ -40,5 +40,5 @@
   tcoords.pc1_1  = tcoords.pc2_2 = 1.0;
   tcoords.pc1_2  = tcoords.pc2_1 = 0.0;
-  strcpy (tcoords.ctype, "RA---TAN");
+  strcpy (tcoords.ctype, "DEC--TAN");
 
   double RminSkyRegion = region[0].Rmin;
@@ -412,5 +412,5 @@
   tcoords.Npolyterms = 0;
   memset (tcoords.polyterms, 0, 14*sizeof(float));
-  strcpy (tcoords.ctype, "RA---TAN");
+  strcpy (tcoords.ctype, "DEC--TAN");
 
   /* compare with each region file */
Index: /branches/eam_branches/ipp-20131211/Ohana/src/uniphot/src/find_image_sgroups.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/uniphot/src/find_image_sgroups.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/uniphot/src/find_image_sgroups.c	(revision 36398)
@@ -22,5 +22,5 @@
   coords.pc1_1 = coords.pc2_2 = 1.0;
   coords.pc1_2 = coords.pc2_1 = 0.0;
-  strcpy (coords.ctype, "RA---TAN");
+  strcpy (coords.ctype, "DEC--TAN");
   
   Ngroup = 0;
Index: /branches/eam_branches/ipp-20131211/Ohana/src/uniphot/src/update_dvo_uniphot.c
===================================================================
--- /branches/eam_branches/ipp-20131211/Ohana/src/uniphot/src/update_dvo_uniphot.c	(revision 36397)
+++ /branches/eam_branches/ipp-20131211/Ohana/src/uniphot/src/update_dvo_uniphot.c	(revision 36398)
@@ -61,5 +61,5 @@
   coords.pc1_1 = coords.pc2_2 = 1.0;
   coords.pc1_2 = coords.pc2_1 = 0.0;
-  strcpy (coords.ctype, "RA---TAN");
+  strcpy (coords.ctype, "DEC--TAN");
   
   for (i = 0; i < pglob.gl_pathc; i++) {
