Index: trunk/Ohana/src/opihi/cmd.astro/cgrid.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.astro/cgrid.c	(revision 7039)
+++ trunk/Ohana/src/opihi/cmd.astro/cgrid.c	(revision 7080)
@@ -16,13 +16,12 @@
   int NorthPole, SouthPole, N, OnPic, LOnPic, status, NELEMENTS, First;
   Graphdata graphmode;
-  int Ngraph;
-
-  Ngraph = 0;
-  if (!GetGraph (&graphmode, NULL, &Ngraph)) return (FALSE);
+
+  if (!style_args (&graphmode, &argc, argv, 0)) return FALSE;
 
   if (argc != 1) {
-    fprintf (stderr, "USAGE: cgrid\n");
+    fprintf (stderr, "USAGE: cgrid [style]\n");
     return (FALSE);
   }
+  SetGraph (graphmode);
 
   /* are we plotting one of the poles? */
Index: trunk/Ohana/src/opihi/cmd.astro/cplot.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.astro/cplot.c	(revision 7039)
+++ trunk/Ohana/src/opihi/cmd.astro/cplot.c	(revision 7080)
@@ -3,16 +3,16 @@
 int cplot (int argc, char **argv) {
   
-  int i, Npts, Ngraph;
+  int i, Npts;
   float *x, *y, *r, *d, Rmin, Rmax;
   Vector Xvec, Yvec, *xvec, *yvec;
   Graphdata graphmode;
 
+  if (!style_args (&graphmode, &argc, argv, 0)) return FALSE;
+
   if (argc != 3) {
-    fprintf (stderr, "USAGE: cplot <ra> <dec>\n");
+    fprintf (stderr, "USAGE: cplot <ra> <dec> [style]\n");
     return (FALSE);
   }
-  
-  Ngraph = 0;
-  if (!GetGraph (&graphmode, NULL, &Ngraph)) return (FALSE);
+  SetGraph (graphmode);
 
   Rmin = graphmode.coords.crval1 - 182.0;
@@ -45,5 +45,4 @@
   }
   
-  
   Npts = Xvec.Nelements;
   graphmode.etype = 0;
@@ -56,5 +55,4 @@
     
   return (TRUE);
-
 }
 
Index: trunk/Ohana/src/opihi/cmd.astro/czplot.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.astro/czplot.c	(revision 7039)
+++ trunk/Ohana/src/opihi/cmd.astro/czplot.c	(revision 7080)
@@ -3,5 +3,5 @@
 int czplot (int argc, char **argv) {
   
-  int i, N, Npts, Ngraph;
+  int i, Npts;
   double min, range, Rmin, Rmax;
   float *in, *out, *r, *d, *x, *y;
@@ -9,11 +9,5 @@
   Graphdata graphmode;
 
-  Ngraph = -1;
-  if ((N = get_argument (argc, argv, "-n"))) {
-    remove_argument (N, &argc, argv);
-    Ngraph = atof (argv[N]);
-    remove_argument (N, &argc, argv);
-  }
-  if (!GetGraph (&graphmode, NULL, &Ngraph)) return (FALSE);
+  if (!style_args (&graphmode, &argc, argv, 0)) return FALSE;
 
   if (argc != 6) {
@@ -21,4 +15,5 @@
     return (FALSE);
   }
+  SetGraph (graphmode);
 
   min = atof(argv[4]);
Index: trunk/Ohana/src/opihi/cmd.astro/getvel.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.astro/getvel.c	(revision 7039)
+++ trunk/Ohana/src/opihi/cmd.astro/getvel.c	(revision 7080)
@@ -33,11 +33,11 @@
 
   /* we expect the input image to have units of velocity, lattitude, and longitude */
-  fits_scan (&buf[0].header, "CRVAL1", "%lf", 1, &Vo);
-  fits_scan (&buf[0].header, "CDELT1", "%lf", 1, &dV);
-  fits_scan (&buf[0].header, "CRPIX1", "%lf", 1, &xo);
-  fits_scan (&buf[0].header, "CRVAL2", "%lf", 1, &Bo);
-  fits_scan (&buf[0].header, "CDELT2", "%lf", 1, &dB);
-  fits_scan (&buf[0].header, "CRPIX2", "%lf", 1, &yo);
-  fits_scan (&buf[0].header, "CRVAL3", "%lf", 1, &L);
+  gfits_scan (&buf[0].header, "CRVAL1", "%lf", 1, &Vo);
+  gfits_scan (&buf[0].header, "CDELT1", "%lf", 1, &dV);
+  gfits_scan (&buf[0].header, "CRPIX1", "%lf", 1, &xo);
+  gfits_scan (&buf[0].header, "CRVAL2", "%lf", 1, &Bo);
+  gfits_scan (&buf[0].header, "CDELT2", "%lf", 1, &dB);
+  gfits_scan (&buf[0].header, "CRPIX2", "%lf", 1, &yo);
+  gfits_scan (&buf[0].header, "CRVAL3", "%lf", 1, &L);
   Vo *= 0.001;
   dV *= 0.001;
Index: trunk/Ohana/src/opihi/cmd.astro/medianmap.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.astro/medianmap.c	(revision 7039)
+++ trunk/Ohana/src/opihi/cmd.astro/medianmap.c	(revision 7080)
@@ -47,16 +47,16 @@
   /* duplicate the (in) buffer to the (out), with different size */
   /* this should probably be a function in misc */
-  fits_free_matrix (&out[0].matrix);
-  fits_free_header (&out[0].header);
+  gfits_free_matrix (&out[0].matrix);
+  gfits_free_header (&out[0].header);
   out[0].bitpix = in[0].bitpix;
   out[0].unsign = in[0].unsign;
   out[0].bscale = in[0].bscale;
   out[0].bzero  = in[0].bzero;
-  fits_copy_header (&in[0].header, &out[0].header);
-  fits_modify (&out[0].header, "NAXIS1", "%d", 1, Nx);
-  fits_modify (&out[0].header, "NAXIS2", "%d", 1, Ny);
+  gfits_copy_header (&in[0].header, &out[0].header);
+  gfits_modify (&out[0].header, "NAXIS1", "%d", 1, Nx);
+  gfits_modify (&out[0].header, "NAXIS2", "%d", 1, Ny);
   out[0].header.Naxis[0] = Nx;
   out[0].header.Naxis[1] = Ny;
-  fits_create_matrix (&out[0].header, &out[0].matrix);
+  gfits_create_matrix (&out[0].header, &out[0].matrix);
 
   In = (float *) in[0].matrix.buffer;
Index: trunk/Ohana/src/opihi/cmd.astro/polar.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.astro/polar.c	(revision 7039)
+++ trunk/Ohana/src/opihi/cmd.astro/polar.c	(revision 7080)
@@ -32,18 +32,18 @@
 
   /* we expect the output image to have units of longitude and distance */
-  fits_scan (&in[0].header, "CRVAL1", "%lf", 1, &Lo);
-  fits_scan (&in[0].header, "CDELT1", "%lf", 1, &dL);
-  fits_scan (&in[0].header, "CRPIX1", "%lf", 1, &xo);
-  fits_scan (&in[0].header, "CRVAL2", "%lf", 1, &Do);
-  fits_scan (&in[0].header, "CDELT2", "%lf", 1, &dD);
-  fits_scan (&in[0].header, "CRPIX2", "%lf", 1, &yo);
+  gfits_scan (&in[0].header, "CRVAL1", "%lf", 1, &Lo);
+  gfits_scan (&in[0].header, "CDELT1", "%lf", 1, &dL);
+  gfits_scan (&in[0].header, "CRPIX1", "%lf", 1, &xo);
+  gfits_scan (&in[0].header, "CRVAL2", "%lf", 1, &Do);
+  gfits_scan (&in[0].header, "CDELT2", "%lf", 1, &dD);
+  gfits_scan (&in[0].header, "CRPIX2", "%lf", 1, &yo);
 
   /* we expect the input image to have units of distance X and Y */
-  fits_scan (&out[0].header, "CRVAL1", "%lf", 1, &Mo);
-  fits_scan (&out[0].header, "CDELT1", "%lf", 1, &dM);
-  fits_scan (&out[0].header, "CRPIX1", "%lf", 1, &Xo);
-  fits_scan (&out[0].header, "CRVAL2", "%lf", 1, &No);
-  fits_scan (&out[0].header, "CDELT2", "%lf", 1, &dN);
-  fits_scan (&out[0].header, "CRPIX2", "%lf", 1, &Yo);
+  gfits_scan (&out[0].header, "CRVAL1", "%lf", 1, &Mo);
+  gfits_scan (&out[0].header, "CDELT1", "%lf", 1, &dM);
+  gfits_scan (&out[0].header, "CRPIX1", "%lf", 1, &Xo);
+  gfits_scan (&out[0].header, "CRVAL2", "%lf", 1, &No);
+  gfits_scan (&out[0].header, "CDELT2", "%lf", 1, &dN);
+  gfits_scan (&out[0].header, "CRPIX2", "%lf", 1, &Yo);
 
   Vin  = (float *)in[0].matrix.buffer;
Index: trunk/Ohana/src/opihi/cmd.astro/rotcurve.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.astro/rotcurve.c	(revision 7039)
+++ trunk/Ohana/src/opihi/cmd.astro/rotcurve.c	(revision 7080)
@@ -52,21 +52,21 @@
 
   /* we expect the input image to have units of velocity, lattitude, and longitude */
-  fits_scan (&in[0].header, "CRVAL1", "%lf", 1, &Vo);
-  fits_scan (&in[0].header, "CDELT1", "%lf", 1, &dV);
-  fits_scan (&in[0].header, "CRPIX1", "%lf", 1, &xo);
-  fits_scan (&in[0].header, "CRVAL2", "%lf", 1, &Bo);
-  fits_scan (&in[0].header, "CDELT2", "%lf", 1, &dB);
-  fits_scan (&in[0].header, "CRPIX2", "%lf", 1, &yo);
-  fits_scan (&in[0].header, "CRVAL3", "%lf", 1, &L);
+  gfits_scan (&in[0].header, "CRVAL1", "%lf", 1, &Vo);
+  gfits_scan (&in[0].header, "CDELT1", "%lf", 1, &dV);
+  gfits_scan (&in[0].header, "CRPIX1", "%lf", 1, &xo);
+  gfits_scan (&in[0].header, "CRVAL2", "%lf", 1, &Bo);
+  gfits_scan (&in[0].header, "CDELT2", "%lf", 1, &dB);
+  gfits_scan (&in[0].header, "CRPIX2", "%lf", 1, &yo);
+  gfits_scan (&in[0].header, "CRVAL3", "%lf", 1, &L);
   Vo *= 0.001;
   dV *= 0.001;
 
   /* we expect the output image to have units of longitude and distance */
-  fits_scan (&out[0].header, "CRVAL1", "%lf", 1, &Lo);
-  fits_scan (&out[0].header, "CDELT1", "%lf", 1, &dL);
-  fits_scan (&out[0].header, "CRPIX1", "%lf", 1, &Xo);
-  fits_scan (&out[0].header, "CRVAL2", "%lf", 1, &Do);
-  fits_scan (&out[0].header, "CDELT2", "%lf", 1, &dD);
-  fits_scan (&out[0].header, "CRPIX2", "%lf", 1, &Yo);
+  gfits_scan (&out[0].header, "CRVAL1", "%lf", 1, &Lo);
+  gfits_scan (&out[0].header, "CDELT1", "%lf", 1, &dL);
+  gfits_scan (&out[0].header, "CRPIX1", "%lf", 1, &Xo);
+  gfits_scan (&out[0].header, "CRVAL2", "%lf", 1, &Do);
+  gfits_scan (&out[0].header, "CDELT2", "%lf", 1, &dD);
+  gfits_scan (&out[0].header, "CRPIX2", "%lf", 1, &Yo);
 
   while (L >= 360) {L -= 360.0;}
