Index: unk/Ohana/src/markstar/src/old/add_unfound.c
===================================================================
--- /trunk/Ohana/src/markstar/src/old/add_unfound.c	(revision 4844)
+++ 	(revision )
@@ -1,35 +1,0 @@
-  /* incorporate unmatched image stars -- after all catalogs searched... */
-  for (i = 0; i < Nstars; i++) {
-    if (!found[i]) {
-      catalog[0].average[Nave].R = stars[N1[i]].R;
-      catalog[0].average[Nave].D = stars[N1[i]].D;
-      catalog[0].average[Nave].M = 1000.0*stars[N1[i]].M;
-      catalog[0].average[Nave].Nm = 1;
-      catalog[0].average[Nave].Xp = catalog[0].average[Nave].Xm = 0.0;
-      catalog[0].average[Nave].offset = Nmeas;
-      catalog[0].measure[Nmeas].dR  = 0.0;
-      catalog[0].measure[Nmeas].dD  = 0.0;
-      catalog[0].measure[Nmeas].M   = 1000.0*stars[N1[i]].M;
-      catalog[0].measure[Nmeas].dM  = stars[N1[i]].dM;
-      catalog[0].measure[Nmeas].t  = 3600.0 + stars[N1[i]].Y*0.1;
-      catalog[0].measure[Nmeas].average = (0x00ffffff & Nave);
-      /* time of star = time of image + offset + Y*rate */
-      Nave ++;
-      if (Nave == 0x1000000) {
-	fprintf (stderr, "too many stars in catalog\n");
-	clear_lockfile ();
-	exit (0);
-      }
-      if (Nave == NAVE) {
-	NAVE = Nave + 1000;
-	REALLOCATE (next, int, NAVE);
-	REALLOCATE (catalog[0].average, Average, NAVE);
-      }
-      Nmeas ++;
-      if (Nmeas == NMEAS) {
-	NMEAS = Nmeas + 1000;
-	REALLOCATE (next, int, NMEAS);
-	REALLOCATE (catalog[0].measure, Measure, NMEAS);
-      }
-    }
-  }
Index: unk/Ohana/src/markstar/src/old/addstar.c
===================================================================
--- /trunk/Ohana/src/markstar/src/old/addstar.c	(revision 4844)
+++ 	(revision )
@@ -1,70 +1,0 @@
-# include "addstar.h"
-
-main (argc, argv)
-int argc;
-char **argv;
-{
-
-  FILE *f;
-  int i, Nstars, Nimage, Nregions, Nmissed;
-  Stars *stars, *gstars();
-  Image image, *pimage, *gimages();
-  Catalog catalog;
-  GSCRegion *region, *gregions();
-  struct timeval now, then;  
-  
-  gettimeofday (&then, (void *) NULL);
-  ConfigInit (argc, argv);
-
-  VERBOSE = FALSE;
-  if ((i = get_argument (argc, argv, "-v"))) {
-    VERBOSE = TRUE;
-    remove_argument (i, &argc, argv);
-  }
-  if (argc < 2) {
-    fprintf (stderr, "ERROR: Usage: addstar filename\n");
-    exit (0);
-  }
-
-  /* if lockfile exists, program will complain and quit */
-  check_lockfile ();
-
-  stars = gstars (argv[1], &Nstars, &image);
-
-  pimage = gimages (&image, &Nimage);
-  region = gregions (&image, &Nregions);
-
-  for (i = 0; i < Nregions; i++) {
-    gcatalog (&region[i], &catalog);
-    find_matches (&region[i], stars, Nstars, &catalog, &image, pimage, Nimage);
-    wcatalog (&region[i], &catalog);
-  }
-  
-  for (Nmissed = i = 0; i < Nstars; i++) {
-    if (stars[i].found == -1) {
-      fprintf (stderr, "%d %f %f %f %f\n", i, stars[i].R, stars[i].D, stars[i].M, stars[i].dM);
-      Nmissed ++;
-    }
-  }
-  if (Nmissed) fprintf (stderr, "WARNING: %d stars in image were missed!\n", Nmissed);
-
-  wimage (argv[1], &image, Nstars);
-
-  if (VERBOSE) {
-    gettimeofday (&now, (void *) NULL);
-    fprintf (stderr, "%s: elapsed time = %.2f sec\n", argv[1], 
-	     (now.tv_sec - then.tv_sec) + 1e-6*(now.tv_usec - then.tv_usec));
-  }
-  clear_lockfile ();
-  fprintf (stderr, "SUCCESS\n");
-}
-
-
-  /* stars within a file are not all within 1 region file:
-     1) check if unfound stars are in current region 
-     2) if not, keep unfound for next pass */
-
-
-/* input star lists should be adjusted so 1 e/sec is mag 25.000 */ 
-
-
Index: unk/Ohana/src/markstar/src/old/dumpcat.c
===================================================================
--- /trunk/Ohana/src/markstar/src/old/dumpcat.c	(revision 4844)
+++ 	(revision )
@@ -1,61 +1,0 @@
-# include "addstar.h"
-
-main (argc, argv)
-int argc;
-char **argv;
-{
-
-  int i, j, Nstars, Nimage, Nregions;
-  Average *average;
-  Measure *measure;
-  Missing *missing;
-  Catalog catalog;
-  GSCRegion region;
-  FILE *f;
-  
-  if (argc < 4) {
-    fprintf (stderr, "USAGE: dumpcat catalog output mode(0,1,2,3)\n");
-    clear_lockfile ();
-    exit (0);
-  }
-
-  strcpy (region.filename, argv[1]);
-
-  gcatalog (&region, &catalog);
-
-  f = fopen (argv[2], "w");
-  if (f == (FILE *) NULL) {
-    fprintf (stderr, "failed to open file %s for write\n", argv[2]);
-    clear_lockfile ();
-    exit (0);
-  }
-
-  average = catalog.average;
-  for (i = 0; i < catalog.Naverage; i++) {
-    fprintf (f, "%10.6f %10.6f %7.3f %3d %3d %8d %d\n", average[i].R, average[i].D, 
-	     0.001*average[i].M, average[i].Nm, average[i].Nn, average[i].offset, catalog.measure[average[i].offset].t);
-    if ((atof(argv[3]) == 1) || (atof(argv[3]) == 3)) {
-      measure = &catalog.measure[average[i].offset];
-      for (j = 0; j < average[i].Nm; j++) {
-	fprintf (f, "  %d %d %f %f %d\n", measure[j].dR, measure[j].dD, 0.001*measure[j].M, 
-		  measure[j].t, measure[j].average);
-      }
-    }
-    if ((atof(argv[3]) == 2) || (atof(argv[3]) == 3)) {
-      if (average[i].Nn > 0) {
-	missing = &catalog.missing[average[i].missing];
-	for (j = 0; j < average[i].Nn; j++) {
-	  fprintf (f, "  %f\n", missing[j].t);
-	}
-      } else { 
-	fprintf (f, "no missing obs\n");
-      }
-    }
-  }
-
-    
-
-  fclose (f);
-    
-
-}
Index: unk/Ohana/src/markstar/src/old/find_bright_stars_test.c
===================================================================
--- /trunk/Ohana/src/markstar/src/old/find_bright_stars_test.c	(revision 4844)
+++ 	(revision )
@@ -1,106 +1,0 @@
-# include "markstar.h"
-
-find_bright_stars (catalog, catstats, filename)
-Catalog catalog[];
-CatStats catstats[];
-char *filename;
-{
-
-  int i, j, first_j, Nave, Ngsc;
-  Catalog GSCdata;
-  double MinRA, MinDEC, MaxRA, MaxDEC, RaCenter, DecCenter;
-  Coords *tcoords;
-  float *X1, *Y1, *X2, *Y2;
-  int *N1, *N2, *match;
-  char *mark;
-  double dX, dY, dR, RADIUS2, BRIGHT_RADIUS, radius;
-
-  load_gsc_data (&GSCdata, filename);
-
-  Nave = catalog[0].Naverage;
-  Ngsc = GSCdata.Naverage;
-    
-  X1 = catstats[0].X;
-  Y1 = catstats[0].Y;
-  N1 = catstats[0].N;
-  ALLOCATE (mark, char, Nave);
-  ALLOCATE (match, int, Nave);
-  ALLOCATE (X2, float, Ngsc);
-  ALLOCATE (Y2, float, Ngsc);
-  ALLOCATE (N2, int, Ngsc);
-  bzero (mark, Nave);
-
-  tcoords = &catstats[0].coords;
-  for (i = 0; i < Ngsc; i++) {
-    fRD_to_XY (&X2[i], &Y2[i], GSCdata.average[i].R, GSCdata.average[i].D, tcoords);
-    N2[i] = i;
-  }
-  if (Ngsc > 1) sort_lists (X2, Y2, N2, Ngsc);
-  
-  /* max radius (mag = -1) */
-  BRIGHT_RADIUS = BRIGHT_SLOPE * (-1.0 - BRIGHT_MAG);
-
-  /** find catalog stars near GSC stars **/
-  for (i = j = 0; (i < Nave) && (j < Ngsc); ) {
-    
-    dX = X1[i] - X2[j];
-
-    if (dX <= -2*BRIGHT_RADIUS) {
-      i++;
-      continue;
-    }
-    if (dX >= 2*BRIGHT_RADIUS) {
-      j++;
-      continue;
-    }
-
-    /* negative dX: j is too large, positive dX, i is too large */
-    first_j = j;
-    for (; (dX > -2*BRIGHT_RADIUS) && (j < Ngsc); j++) {
-      radius = MAX (BRIGHT_SLOPE * (0.001*GSCdata.average[N2[j]].M - BRIGHT_MAG), 0.0);
-      RADIUS2 = radius*radius;
-      dX = X1[i] - X2[j];
-      dY = Y1[i] - Y2[j];
-      dR = dX*dX + dY*dY;
-      if (dR < RADIUS2) {  /* new measurement of this star */
-	mark[i] = TRUE;
-	match[i] = N2[j];
-      }
-    }
-    j = first_j;
-    i++;
-  }
-  
-  /* done with search, mark selected stars */
-  
-  for (i = 0; i < Nave; i++) {
-    if (mark[i]) {
-      catalog[0].average[N1[i]].code = ID_BLEED;
-    }
-  } 
-  
-}
-
-	/* for test purposes, like determining the parameters, uncomment this 
-	n = N1[i];
-	m = N2[j];
-	fprintf (stdout, "%f %f %f %f %f %f\n", 
-GSCdata.average[m].R, GSCdata.average[m].D, 
-		 0.001*GSCdata.average[m].M, 
-catalog[0].average[n].R, catalog[0].average[n].D, 0.001*catalog[0].average[n].M); */
-  
-  /* for test purposes, like determining the parameters, uncomment this 
-  clear_lockfile (); 
-  fprintf (stderr, "SUCCESS\n");
-  exit (0); */
-
-
-
-	n = N1[i];
-	m = N2[j];
-	RD_to_XY (&X, &Y, Ghostdata[0].average[m].R, Ghostdata[0].average[m].D, &image[0].coords);
-	fprintf (stdout, "%f %f %f %f %f %f %d %f %f\n",
-		 Ghostdata[0].average[m].R, Ghostdata[0].average[m].D, 
-		 0.001*Ghostdata[0].average[m].M, catalog[0].average[n].R, 
-		 catalog[0].average[n].D, 0.001*catalog[0].average[n].M, 
-		 catalog[0].average[n].Nm, X, Y);
Index: unk/Ohana/src/markstar/src/old/gimages.c
===================================================================
--- /trunk/Ohana/src/markstar/src/old/gimages.c	(revision 4844)
+++ 	(revision )
@@ -1,214 +1,0 @@
-# include "addstar.h"
-double opening_angle ();
-
-Image *gimages (image, Npimage)
-Image image[];
-int *Npimage;
-{
-  
-  int i, j, k, NIMAGE, Nimage, addtolist;
-  int NTIMAGE, Ntimage, ntimage;
-  int NPIMAGE, npimage;
-  FILE *f;
-  Image *timage, *pimage;
-  Coords tcoords;
-  Header header;
-  double r, d;
-  double Xi[5], Yi[5], Xo[5], Yo[5];  /* image and original corners */
-
-  /* check if image datafile exists, get header */
-  if (!fits_read_header (ImageCat, &header)) {
-    if (VERBOSE) fprintf (stderr, "New image catalog %s (1)\n", ImageCat);
-    *Npimage = 0;
-    return ((Image *) NULL);
-  }
-
-  /* project onto rectilinear grid with 1 arcsec pixels */
-  /* we keep the original crpix1,2 and crref1,2 */
-  tcoords = image[0].coords;
-  tcoords.cdelt1 = tcoords.cdelt2 = 1.0 / 3600.0;
-  tcoords.pc1_1 = tcoords.pc2_2 = 1.0;
-  tcoords.pc1_2 = tcoords.pc2_1 = 0.0;
-  strcpy (tcoords.ctype, "RA---TAN");
-
-  /* define original corners */
-  Xo[0] = 0;           Yo[0] = 0;
-  Xo[1] = image[0].NX; Yo[1] = 0;
-  Xo[2] = image[0].NX; Yo[2] = image[0].NY;
-  Xo[3] = 0;           Yo[3] = image[0].NY;
-  Xo[4] = 0;           Yo[4] = 0;  /* so we can make a loop easily */
-  for (j = 0; j < 5; j++) {
-    XY_to_RD (&r, &d, Xo[j], Yo[j], &image[0].coords);
-    RD_to_XY (&Xo[j], &Yo[j], r, d, &tcoords);
-  }
-  
-  /* get ready to read data on images */ 
-  f = fopen (ImageCat, "r");
-  if (f == (FILE *) NULL) {
-    fprintf (stderr, "New image catalog: %s (2)\n", ImageCat);
-    free (header.buffer);
-    *Npimage = 0;
-    return ((Image *) NULL);
-  }
-  fseek (f, header.size, SEEK_SET); 
-
-  Nimage = 0;
-  fits_scan (&header, "NIMAGES", "%d", 1, &Nimage);
-
-  NTIMAGE = 100;
-  ALLOCATE (timage, Image, NTIMAGE);
-
-  npimage = 0;
-  NPIMAGE = 20;
-  ALLOCATE (pimage, Image, NPIMAGE);
-
-  for (Ntimage = 0; Ntimage < Nimage; Ntimage += ntimage) {
-    ntimage = Fread (timage, sizeof(Image), NTIMAGE, f, "image");
-    for (i = 0; i < ntimage; i++) {
-      addtolist = FALSE;
-      /* define image corners */
-      Xi[0] = 0;            Yi[0] = 0;
-      Xi[1] = timage[i].NX; Yi[1] = 0;
-      Xi[2] = timage[i].NX; Yi[2] = timage[i].NY;
-      Xi[3] = 0;            Yi[3] = timage[i].NY;
-      Xi[4] = 0;            Yi[4] = 0;  /* so we can make a loop easily */
-      /* transform to tcoords */
-      for (j = 0; j < 5; j++) {
-	XY_to_RD (&r, &d, Xi[j], Yi[j], &timage[i].coords);
-	RD_to_XY (&Xi[j], &Yi[j], r, d, &tcoords);
-      }
-      /* check if any edges cross */
-      for (j = 0; j < 4; j++) {
-	for (k = 0; k < 4; k++) {
-	  addtolist |= edge_check (&Xi[j], &Yi[j], &Xo[k], &Yo[k]);
-	}
-      }
-      
-      /*
-      fprintf (stderr, "%f %f %f %d %f %f %d %d %d %f %f %s: %d\n", 0.1*timage[i].detection_limit, 0.1*timage[i].saturation_limit, 0.02*timage[i].cerror, 
-	       timage[i].tzero, 1e-4*timage[i].trate, 
-	       0.001*timage[i].secz, timage[i].nstar, timage[i].NX, timage[i].NY, 0.001*timage[i].Mcal, 0.1*timage[i].Xm, timage[i].name, addtolist);
-      
-      fprintf (stderr, "%s\n", timage[i].coords.ctype);
-      fprintf (stderr, "%f %f\n", timage[i].coords.crval1, timage[i].coords.crval2);
-      fprintf (stderr, "%f %f\n", timage[i].coords.crpix1, timage[i].coords.crpix2);
-      fprintf (stderr, "%f %f\n", timage[i].coords.pc1_1, timage[i].coords.pc1_2);
-      fprintf (stderr, "%f %f\n", timage[i].coords.pc2_1, timage[i].coords.pc2_2);
-      fprintf (stderr, "%f %f\n", timage[i].coords.cdelt1, timage[i].coords.cdelt2);      
-      */
-
-      if (addtolist) {
-	pimage[npimage] = timage[i];
-	npimage ++;
-	if (npimage == NPIMAGE) {
-	  NPIMAGE += 20;
-	  REALLOCATE (pimage, Image, NPIMAGE);
-	}
-      }
-    }
-
-    if (ntimage == 0) {
-      fprintf (stderr, "ERROR: expected %d images, only found %d\n", Nimage, Ntimage);
-      clear_lockfile ();
-      exit (0);
-    }
-  }
-
-  if (VERBOSE) fprintf (stderr, "found %d overlapping images\n", npimage);
-
-  fclose (f);
-  *Npimage = npimage;
-  return (pimage);
-
-}
-  
-int edge_check (x1, y1, x2, y2)
-double *x1, *y1, *x2, *y2;
-{
-
-  double theta1, theta2;
-  double Theta1, Theta2;
-
-  theta1 = opening_angle (x1[0], y1[0], x2[0], y2[0], x1[1], y1[1]); 
-  theta2 = opening_angle (x1[0], y1[0], x2[0], y2[0], x2[1], y2[1]); 
-
-  if (theta1*theta2 < 0.0) {
-    return (FALSE);
-  }
-
-  if (fabs(theta1) < fabs(theta2)) {
-    return (FALSE);
-  }
-
-  Theta1 = theta1;
-  Theta2 = theta2;
-  theta1 = opening_angle (x2[0], y2[0], x1[1], y1[1], x2[1], y2[1]); 
-  theta2 = opening_angle (x2[0], y2[0], x1[1], y1[1], x1[0], y1[0]); 
-  
- 
-  if (theta1*theta2 < 0.0) {
-    return (FALSE);
-  }
-
-  if (fabs(theta1) < fabs(theta2)) {
-    return (FALSE);
-  }
-
-  return (TRUE);
-
-}
-
-double opening_angle (x1, y1, x2, y2, x3, y3)
-double x1, y1, x2, y2, x3, y3;
-{
-
-  double dx1, dy1, dx2, dy2, ct, st, theta;
-
-  dx1 = x1 - x2;
-  dy1 = y1 - y2;
-  
-  dx2 = x3 - x2;
-  dy2 = y3 - y2;
-  
-  ct = (dx1*dx2 + dy1*dy2);
-  st = (dx1*dy2 - dx2*dy1);
-
-  theta = atan2 (st, ct);
-
-  return (theta);
-
-}
-
-
-
-
-/* probably not needed now 
-char *_parse_nextword();
-
-
-int fparse (X, NX, line)
-float *X;
-int NX;
-char *line;
-{
-
-  int i;
-  char *word;
-  char *ptr;
-
-  word = line;
-  for (i = 0; i < NX - 1; i++)
-    word = _parse_nextword (word);
-
-  *X = strtod (word, &ptr);
-  if (ptr == word)
-    return (FALSE);
-  else {
-    if (word[0] == '-') 
-      return (-1);
-    else
-      return (1);
-  }
-}
-
-*/
Index: unk/Ohana/src/markstar/src/old/gstars.c
===================================================================
--- /trunk/Ohana/src/markstar/src/old/gstars.c	(revision 4844)
+++ 	(revision )
@@ -1,186 +1,0 @@
-# include "addstar.h"
-# define D_NSTARS 1000
-# define BYTES_STAR 31
-# define BLOCK 1000
-#include <sys/time.h>
-#include <time.h>
-
-Stars *gstars (file, NSTARS, image) 
-char file[];
-int *NSTARS;
-Image *image;
-{
-
-  FILE *f;
-  Header header;
-  int i, j, nstar;
-  int nbytes, Nbytes;
-  Stars *stars;
-  char *buffer, line[64], *c;
-  struct tm timeptr;
-  double tmp;
-
-  if (!fits_read_header (file, &header)) {
-    fprintf (stderr, "ERROR: can't find image file %s\n", file);
-    clear_lockfile ();
-    exit(0);
-  }
-
-  /* open file */
-  f = fopen (file, "r");
-  if (f == NULL) {
-    fprintf (stderr, "ERROR: can't find data file %s\n", file);
-    clear_lockfile ();
-    exit(0);
-  }
-  fseek (f, header.size, SEEK_SET); 
-
-  c = strrchr (file, 0x2f);
-  if (c == (char *) NULL) {
-    strcpy (image[0].name, file);
-  } else { 
-    strcpy (image[0].name, (c+1));
-  }
-  /* get astrometry information */
-  strcpy (image[0].coords.ctype, "NONE");
-  fits_scan (&header, "CTYPE1",   "%s",  1, image[0].coords.ctype);
-  if (strcmp (image[0].coords.ctype, "RA---PLY")) {
-    fprintf (stderr, "ERROR: wrong astrometric info in header\n");
-    clear_lockfile ();
-    exit (0);
-  }
-  fits_scan (&header, "CDELT1",   "%f", 1, &image[0].coords.cdelt1); 
-  fits_scan (&header, "CDELT2",   "%f", 1, &image[0].coords.cdelt2);
-  fits_scan (&header, "CRVAL1",   "%lf", 1, &image[0].coords.crval1);
-  fits_scan (&header, "CRVAL2",   "%lf", 1, &image[0].coords.crval2);  
-  fits_scan (&header, "CRPIX1",   "%f", 1, &image[0].coords.crpix1);
-  fits_scan (&header, "CRPIX2",   "%f", 1, &image[0].coords.crpix2);
-  fits_scan (&header, "PC001001", "%f", 1, &image[0].coords.pc1_1);
-  fits_scan (&header, "PC001002", "%f", 1, &image[0].coords.pc1_2);
-  fits_scan (&header, "PC002001", "%f", 1, &image[0].coords.pc2_1);
-  fits_scan (&header, "PC002002", "%f", 1, &image[0].coords.pc2_2);
-  fits_scan (&header, "CERROR",   "%lf", 1, &tmp);
-  /* RA Terms */
-  fits_scan (&header, "PCA1X2Y0", "%f", 1, &image[0].coords.polyterms[0][0]);
-  fits_scan (&header, "PCA1X1Y1", "%f", 1, &image[0].coords.polyterms[1][0]);
-  fits_scan (&header, "PCA1X0Y2", "%f", 1, &image[0].coords.polyterms[2][0]);
-  fits_scan (&header, "PCA1X3Y0", "%f", 1, &image[0].coords.polyterms[3][0]);
-  fits_scan (&header, "PCA1X2Y1", "%f", 1, &image[0].coords.polyterms[4][0]);
-  fits_scan (&header, "PCA1X1Y2", "%f", 1, &image[0].coords.polyterms[5][0]);
-  fits_scan (&header, "PCA1X0Y3", "%f", 1, &image[0].coords.polyterms[6][0]);
-  /* Dec Terms */
-  fits_scan (&header, "PCA2X2Y0", "%f", 1, &image[0].coords.polyterms[0][1]);
-  fits_scan (&header, "PCA2X1Y1", "%f", 1, &image[0].coords.polyterms[1][1]);
-  fits_scan (&header, "PCA2X0Y2", "%f", 1, &image[0].coords.polyterms[2][1]);
-  fits_scan (&header, "PCA2X3Y0", "%f", 1, &image[0].coords.polyterms[3][1]);
-  fits_scan (&header, "PCA2X2Y1", "%f", 1, &image[0].coords.polyterms[4][1]);
-  fits_scan (&header, "PCA2X1Y2", "%f", 1, &image[0].coords.polyterms[5][1]);
-  fits_scan (&header, "PCA2X0Y3", "%f", 1, &image[0].coords.polyterms[6][1]);
-  image[0].coords.Npolyterms = 2; /* how many do we use? */
-  /* CERROR in data file is in pixels, convert to 20*arcsec */
-  image[0].cerror = tmp * 50.0 * image[0].coords.cdelt1 * 3600.0;
-  while (image[0].coords.crval1 < 0) image[0].coords.crval1 += 360.0;
-  while (image[0].coords.crval1 > 360.0) image[0].coords.crval1 -= 360.0;
- 
-  fits_scan (&header, "NAXIS1",   "%hd", 1, &image[0].NX); 
-  fits_scan (&header, "NAXIS2",   "%hd", 1, &image[0].NY);
-  fits_scan (&header, "PHOTCODE", "%hd", 1, &image[0].source);
-  image[0].NX -= XOVERSCAN;
-  image[0].NY -= YOVERSCAN;
-
-  tmp = 0;
-  fits_scan (&header, "FLIMIT",   "%lf", 1, &tmp);
-  image[0].detection_limit = tmp * 10.0;
-
-  tmp = 0;
-  fits_scan (&header, "FSATUR",   "%lf", 1, &tmp);
-  image[0].saturation_limit = tmp * 10.0;
-
-  if (!fits_scan (&header, "TZERO",   "%d",  1, &image[0].tzero)) {
-    fits_scan (&header, "UT",   "%s",  1, line);
-    /* remove : characters */
-    for (c = strchr (line, 0x3a); c != (char *) NULL; c = strchr (c, 0x3a))
-      *c = ' ';
-    sscanf (line, "%d %d %d", &timeptr.tm_hour, &timeptr.tm_min, &timeptr.tm_sec);
-    fits_scan (&header, "DATE-UT",   "%s",  1, line);
-    for (c = strchr (line, 0x2f); c != (char *) NULL; c = strchr (c, 0x2f))
-      *c = ' ';
-    sscanf (line, "%d %d %d", &timeptr.tm_year, &timeptr.tm_mon, &timeptr.tm_mday);
-    if (timeptr.tm_year < 90) { /* correct for year 2000 turnover */
-      timeptr.tm_year += 100;
-    }
-    image[0].tzero = mktime (&timeptr);
-  }
-
-  tmp = 0;
-  fits_scan (&header, "TRATE",   "%lf", 1, &tmp);
-  image[0].trate = 10000 * tmp;
-
-  tmp = 0;
-  fits_scan (&header, "AIRMASS", "%lf", 1, &tmp);
-  image[0].secz = 1000*tmp;
-
-  /* secz is in units milli-airmass */
-  image[0].Mcal =  ALPHA*(image[0].secz - 1000);
-  image[0].Xm   = 30.0;
-  image[0].code = 0;
-  bzero (image[0].dummy, sizeof(image[0].dummy));
-
-  /* find number of stars */
-  fits_scan (&header, "NSTARS", "%d", 1, &image[0].nstar);
-  if (image[0].nstar == 0) {
-    fprintf (stderr, "ERROR: can't get NSTARS from header\n");
-    clear_lockfile ();
-    exit (0);
-  }
-  ALLOCATE (stars, Stars, image[0].nstar);
-  Nbytes = image[0].nstar*BYTES_STAR;
-
-  /* load in stars by blocks of 1000 */
-  nstar = 0;
-  ALLOCATE (buffer, char, (BLOCK*BYTES_STAR));
-  for (i = 0; i < (int)(Nbytes / (BLOCK*BYTES_STAR)); i++) {
-    nbytes = Fread (buffer, 1, (BLOCK*BYTES_STAR), f);
-    if (nbytes != BLOCK*BYTES_STAR) {
-      fprintf (stderr, "ERROR: failed to read in stars (1)\n");
-      clear_lockfile ();
-      exit (0);
-    }
-    for (j = 0; j < BLOCK; j++, nstar++) {
-      dparse (&stars[nstar].X,  1, &buffer[j*BYTES_STAR]);
-      dparse (&stars[nstar].Y,  2, &buffer[j*BYTES_STAR]);
-      dparse (&stars[nstar].M,  3, &buffer[j*BYTES_STAR]);
-      dparse (&stars[nstar].dM, 4, &buffer[j*BYTES_STAR]);
-      XY_to_RD (&stars[nstar].R, &stars[nstar].D, stars[nstar].X, stars[nstar].Y, &image[0].coords);
-      stars[nstar].found = -1;
-    }
-  }
-  /* left over fraction of a block */
-  nbytes = Fread (buffer, 1, (Nbytes % (BLOCK*BYTES_STAR)), f, "char");
-  if (nbytes != (Nbytes % (BLOCK*BYTES_STAR))) {
-    fprintf (stderr, "ERROR: failed to read in stars (2)\n");
-    clear_lockfile ();
-    exit (0);
-  }
-  for (j = 0; j < nbytes / BYTES_STAR; j++, nstar++) {
-    dparse (&stars[nstar].X, 1, &buffer[j*BYTES_STAR]);
-    dparse (&stars[nstar].Y, 2, &buffer[j*BYTES_STAR]);
-    dparse (&stars[nstar].M, 3, &buffer[j*BYTES_STAR]);
-    dparse (&stars[nstar].dM, 4, &buffer[j*BYTES_STAR]);
-    XY_to_RD (&stars[nstar].R, &stars[nstar].D, stars[nstar].X, stars[nstar].Y, &image[0].coords);
-    stars[nstar].found = -1;
-  }
-
-  if (image[0].nstar != nstar) {
-    fprintf (stderr, "ERROR: failed to read in all stars (%d != %d)\n", image[0].nstar, nstar);
-    clear_lockfile ();
-    exit (0);
-  }
-  free (header.buffer);
-  free (buffer);
- 
-  if (VERBOSE) fprintf (stderr, "read %d stars from target file\n", image[0].nstar);
-  *NSTARS = image[0].nstar;
-
-  return (stars);
-}
Index: unk/Ohana/src/markstar/src/old/sort_lists.c
===================================================================
--- /trunk/Ohana/src/markstar/src/old/sort_lists.c	(revision 4844)
+++ 	(revision )
@@ -1,48 +1,0 @@
-
-sort_lists (X, Y, S, N) 
-float *X, *Y;
-int *S, N;
-{
-  int l,j,ir,i;
-  double tX, tY, tS;
-  
-  l = N >> 1;
-  ir = N - 1;
-  for (;;) {
-    if (l > 0) {
-      l--;
-      tX = X[l];
-      tY = Y[l];
-      tS = S[l];
-    }
-    else {
-      tX = X[ir];
-      X[ir] = X[0];
-      tY = Y[ir];
-      Y[ir] = Y[0];
-      tS = S[ir];
-      S[ir] = S[0];
-      if (--ir == 0) {
-	X[0] = tX;
-	Y[0] = tY;
-	S[0] = tS;
-	return;
-      }
-    }
-    i = l;
-    j = (l << 1) + 1;
-    while (j <= ir) {
-      if (j < ir && X[j] < X[j+1]) j++;
-      if (tX < X[j]) {
-	X[i] = X[j];
-	Y[i] = Y[j];
-	S[i] = S[j];
-	j += (i=j) + 1;
-      }
-      else j = ir + 1;
-    }
-    X[i] = tX;
-    Y[i] = tY;
-    S[i] = tS;
-  }
-}
Index: unk/Ohana/src/markstar/src/old/sort_stars.c
===================================================================
--- /trunk/Ohana/src/markstar/src/old/sort_stars.c	(revision 4844)
+++ 	(revision )
@@ -1,61 +1,0 @@
-# include "relphot.h"
-
-void sort_stars (radec, stars, Nstars)
-int  **radec;
-Star  *stars;
-int    Nstars;
-{
-  
-  int i;
-  double *RAs;
-
-  ALLOCATE (radec[0], int, Nstars);
-  ALLOCATE (RAs, double, Nstars);
-  for (i = 0; i < Nstars; i++) {
-    radec[0][i] = i;
-    RAs[i] = stars[i].RA;
-  }
-
-  sort_seq (radec[0], RAs, Nstars);
-  free (RAs);
-
-}
-
-
-void sort_seq (seq, value, N) 
-int *seq;
-double *value;
-int N;
-{
-  int l,j,ir,i;
-  int temp;
-  
-  l = N >> 1;
-  ir = N - 1;
-  for (;;) {
-    if (l > 0) {
-      temp = seq[--l];
-    }
-    else {
-      temp = seq[ir];
-      seq[ir] = seq[0];
-      if (--ir == 0) {
-	seq[0] = temp;
-	return;
-      }
-    }
-    i = l;
-    j = (l << 1) + 1;
-    while (j <= ir) {
-      if (j < ir && value[seq[j]] < value[seq[j+1]]) ++j;
-      if (value[temp] < value[seq[j]]) {
-	seq[i]=seq[j];
-	j += (i=j) + 1;
-      }
-      else j = ir + 1;
-    }
-    seq[i] = temp;
-  }
-}
-
-
Index: unk/Ohana/src/markstar/src/old/string.c
===================================================================
--- /trunk/Ohana/src/markstar/src/old/string.c	(revision 4844)
+++ 	(revision )
@@ -1,64 +1,0 @@
-# include <stdio.h>
-# include <math.h>
-# define TRUE  1
-# define FALSE 0
-
-int scan_line (f, line) 
-FILE *f;
-char line[];
-{
-
-  int i, status;
-  char c;
-  
-  status = EOF + 1;
-  
-  for (i = 0, c = 0; (c != '\n') && (status != EOF); i++) {
-    status = fscanf (f, "%c", &c);
-    line[i] = c;
-  }
-  line[i - 1] = 0;  /* this could make things crash! */
-
-  if (i > 1) {
-    status = EOF + 1;
-  }
-
-  return (status);
-
-}
-
-char *_parse_nextword(string)
-char *string;
-{
-  if (string == (char *) NULL) return ((char *) NULL);
-
-  for (; isspace (*string); string++);
-  for (; (*string != 0) && !isspace (*string); string++);
-  for (; isspace (*string); string++);
-  return (string);
-}
-
-int dparse (X, NX, line)
-double *X;
-int NX;
-char *line;
-{
-
-  int i;
-  char *word;
-  char *ptr;
-
-  word = line;
-  for (i = 0; i < NX - 1; i++)
-    word = _parse_nextword (word);
-
-  *X = strtod (word, &ptr);
-  if (ptr == word)
-    return (FALSE);
-  else {
-    if (word[0] == '-') 
-      return (-1);
-    else
-      return (1);
-  }
-}
Index: unk/Ohana/src/markstar/src/old/wimage.c
===================================================================
--- /trunk/Ohana/src/markstar/src/old/wimage.c	(revision 4844)
+++ 	(revision )
@@ -1,67 +1,0 @@
-# include "addstar.h"
-
-wimage (filename, image, Nstars)
-char *filename;
-Image image[];
-int Nstars;
-{
-  
-  int Nimages, status;
-  FILE *f;
-  Header header;
-
-  if (!fits_read_header (ImageCat, &header)) {
-    if (VERBOSE) fprintf (stderr, "can't find %s, creating a new one\n", ImageCat);
-    if (!fits_read_header (ImageTemplate, &header)) {
-      fprintf (stderr, "ERROR: can't find template header %s\n", ImageTemplate);
-      clear_lockfile ();
-      exit (0);
-    }
-    f = fopen (ImageCat, "w");
-    if (f == NULL) {
-      fprintf (stderr, "ERROR: can't create/open image catalog file: %s\n", ImageCat);
-      clear_lockfile ();
-      exit (0);
-    }
-  }
-  
-  Nimages = 0;
-  fits_scan (&header, "NIMAGES", "%d", 1, &Nimages);
-  Nimages ++;
-  fits_modify (&header, "NIMAGES", "%d", 1, Nimages);
-
-  f = fopen (ImageCat, "r+");
-  if (f == NULL) {
-    fprintf (stderr, "ERROR: can't create/open image catalog file: %s\n", ImageCat);
-    clear_lockfile ();
-    exit (0);
-  }
-
-  /* position to begining of file to write header */
-  fseek (f, 0, SEEK_SET);
-  status = Fwrite (header.buffer, 1, header.size, f, "char");
-  if (status != header.size) {
-    fprintf (stderr, "ERRPR: failed writing data to image header\n");
-    clear_lockfile ();
-    exit (0);
-  }
-
-  fseek (f, 0, SEEK_END);
-  fprintf (stderr, "Image: %d\n", sizeof(Image));
-  status = Fwrite (image, sizeof(Image), 1, f, "image");
-  if (status != 1) {
-    fprintf (stderr, "ERRPR: failed writing data to image catalog\n");
-    clear_lockfile ();
-    exit (0);
-  }
-
-  fclose (f);
-  
-
-}
-
-/* the image we add in this routine is always a new image.  
-   We only need to do two things:
-     1) append the data for the image to the end of the file
-     2) update the NIMAGES field in the header (which means, read in header, re-write)
- */
