Index: /trunk/Ohana/src/libohana/Makefile
===================================================================
--- /trunk/Ohana/src/libohana/Makefile	(revision 4025)
+++ /trunk/Ohana/src/libohana/Makefile	(revision 4026)
@@ -4,4 +4,5 @@
 AUTO	=	$(ROOT)/src/libautocode
 ASRC	=	$(AUTO)/src
+ADEF	=	$(AUTO)/def
 LIB	= 	$(HOME)/lib
 SRC	=	$(HOME)/src
@@ -52,4 +53,5 @@
 
 AOBJ = \
+$(ASRC)/coords.$(ARCH).o \
 $(ASRC)/regimage.$(ARCH).o \
 $(ASRC)/detreg.$(ARCH).o \
@@ -58,12 +60,13 @@
 $(ASRC)/smpdata.$(ARCH).o \
 $(ASRC)/spectrum.$(ARCH).o \
-$(ASRC)/spectrum-ascii.$(ARCH).o
+$(ASRC)/spectrum-ascii.$(ARCH).o \
+$(ASRC)/image.$(ARCH).o
 
-autocode: $(INC1)
-	cd $(AUTO) && make install
+ACOM = $(ADEF)/autocode.c $(ADEF)/autocode.h $(ADEF)/common.h
 
 $(OBJ1): $(INC1)
 $(OBJ2): $(INC2)
-$(AOBJ): autocode
+$(AOBJ): $(ASRC)/%.$(ARCH).o : $(ADEF)/%.d $(ACOM)
+	cd $(AUTO) && make objects
 
 $(DESTLIB)/libohana.a: $(LIB)/libohana.$(ARCH).a
@@ -72,5 +75,5 @@
 	cp $(LIB)/libohana.$(ARCH).a $(DESTLIB)/libohana.a
 
-$(LIB)/libohana.$(ARCH).a: autocode $(OBJ1) $(AOBJ) $(OBJ2)
+$(LIB)/libohana.$(ARCH).a: $(OBJ1) $(OBJ2) $(AOBJ)
 	@if [ ! -d $(LIB) ]; then mkdir -p $(LIB); fi
 	rm -f $(LIB)/libohana.$(ARCH).a
@@ -96,3 +99,3 @@
 .c.$(ARCH).o:
 	$(CC) $(CFLAGS) -c $*.c -o $@
-	@echo done with $*.o
+	@echo XXX done with $*.o
Index: /trunk/Ohana/src/libohana/include/dvo.h
===================================================================
--- /trunk/Ohana/src/libohana/include/dvo.h	(revision 4025)
+++ /trunk/Ohana/src/libohana/include/dvo.h	(revision 4026)
@@ -17,4 +17,5 @@
 } FITS_DB;
 
+# if (0)
 /* the standard astrometric coordinates structure */
 typedef struct {
@@ -28,4 +29,5 @@
   char     Npolyterms;
 } Coords;  /* 120 bytes / Coords */
+# endif
 
 /* in fits_db.c */
@@ -39,5 +41,5 @@
 int   fits_db_update              PROTO((FITS_DB *db, VTable *vtable));
 
-/* in coords.c */
+/* in coords.c, using libautocode/def/coords.d */
 int  XY_to_RD (double *ra, double *dec, double x,  double y,   Coords *coords);
 int  RD_to_XY (double *x,  double *y,   double ra, double dec, Coords *coords);
Index: /trunk/Ohana/src/libohana/include/elixir.h
===================================================================
--- /trunk/Ohana/src/libohana/include/elixir.h	(revision 4025)
+++ /trunk/Ohana/src/libohana/include/elixir.h	(revision 4026)
@@ -15,55 +15,4 @@
 
 # if (0)
-/* structure for Image Registration Database */
-typedef struct {
-  char filename[64];
-  char pathname[128];
-  char filter[32];
-  char instrument[32];
-  char ccd;                        /* an identifier for CCD in mosaic (0 for single ccd) */
-  char mode;                       /* MEF, SINGLE, SPLIT */
-  char type;                       /* image type */
-  char flag;                       /* image status flags */
-  char seq;                        /* cube sequence number */
-  char junk[23];
- 
-  float exptime;
-  float airmass;
-  float sky;
-  float bias;
-  float fwhm;
-
-  float telfocus;
-  float xprobe, yprobe, zprobe;
-  float dettemp;
-  float teltemp[4];
-  float rotangle;
-  float ra, dec;
-
-  e_time obstime;
-  e_time regtime;
-} RegImage;  /* 360 bytes / image */
-# endif 
-
-# if (0)
-/* Detrend Database structure */
-typedef struct {
-  e_time tstart;
-  e_time tstop;
-  e_time treg;
-  float exptime;
-  int type;
-  int filter;
-  int ccd;
-  int Nentry;
-  int Norder;
-  char mode;
-  char altpath;   /* true: data on alt db paths */
-  char dummy[58]; /* for future expansion */
-  char label[64];
-  char filename[256];
-} DetReg;    /* 416 bytes */
-# endif
-
 /* average data as stored in the LONEOS database */
 typedef struct {
@@ -111,45 +60,4 @@
 } SecFilt; /* 6 byte / SecFilt */
 
-/* image structure for binary data storage of image data */
-typedef struct {
-  Coords         coords;            /* 120 bytes */
-  unsigned int   tzero;             /* readout time row 0 in sec (0 - 142 years valid range) */
-  unsigned int   nstar;             /* number of stars on image */
-  short int      secz;              /* thousanths of airmass (valid range -32.000 -- 32.000) */
-  short int      NX, NY;            /* dimensions of image */
-  short int      apmifit, dapmifit; /* aperture correction and error in thousandths of mag */
-  short int      source;            /* identifier for CCD (each ever used will have a unique letter) */
-  short int      Mcal;              /* thousandths of mag (-32.000 -- 32.000 valid range) */
-  short int      dMcal;             /* thousandths of mag (-32.000 -- 32.000 valid range) */
-  short int      Xm;                /* 10*log(image chi-square) */
-  char           name[32];          /* name of original image */
-  unsigned char  detection_limit;   /* tenths of mag (0.0 - 25.6 valid range) */
-  unsigned char  saturation_limit;  /* tenths of mag (0.0 - 25.6 valid range) */
-  unsigned char  cerror;            /* astrometric error: 1/50 of arcsec (0 -- 5.12 valid range) */
-  unsigned char  fwhm_x, fwhm_y;    /* PSF terms in 25*arcsec (valid range 0.0 -- 10.2" ") */
-  unsigned char  trate;             /* 10000 * scan rate in sec/pix (0 -- 0.0256 valid range, 
-				       typically 0.0146. this is used only to determine the time
-				       of the observation, not to find the coordinates.  1 byte
-				       gives 0.11 sec accuracy */
-  float          exptime;           /* exposure time, seconds */
-  char           code;              /* flag to mark an image as bad or whatever */
-  unsigned char  ccdnum;            /* mosaic CCD ID number (IMAGEID) */ 
-  char           dummy[20];         /* extra space for the future */
-  short int      order;             /* number of terms used for Mrel */
-  short int      Mx, My;
-  short int      Mxx, Mxy, Myy;
-  short int      Mxxx, Mxxy, Mxyy, Myyy;
-  short int      Mxxxx, Mxxxy, Mxxyy, Mxyyy, Myyyy;
-} Image;  /* 240 bytes / Image */
-/* Image needs to be aligned with 8-byte boundaries on Suns */
-
-/************  end of database structures ************************************/
-
-/* structure for data on a catalog region */
-typedef struct {
-  char filename[256];
-  double DEC[2], RA[2];
-} GSCRegion;
-
 typedef struct {
   unsigned short int code;   /* code number (stored in Measure.source) */
@@ -163,4 +71,13 @@
   float X[4];                /* color terms X[0]*mc + X[1]*mc^2 + X[2]*mc^3, etc */
 } PhotCode;
+# endif
+
+/************  end of database structures ************************************/
+
+/* structure for data on a catalog region */
+typedef struct {
+  char filename[256];
+  double DEC[2], RA[2];
+} GSCRegion;
 
 typedef struct {
Index: /trunk/Ohana/src/libohana/include/loneos.h
===================================================================
--- /trunk/Ohana/src/libohana/include/loneos.h	(revision 4025)
+++ /trunk/Ohana/src/libohana/include/loneos.h	(revision 4026)
@@ -4,53 +4,4 @@
 
 /************  database structures ************************************/
-
-/* structure for Image Registration Database */
-typedef struct {
-  char filename[64];
-  char pathname[128];
-  char filter[32];
-  char instrument[32];
-  char ccd;                        /* an identifier for CCD in mosaic (0 for single ccd) */
-  char mode;                       /* MEF, SINGLE, SPLIT */
-  char type;                       /* image type */
-  char flag;                       /* image status flags */
-  char junk[24];
- 
-  float exptime;
-  float airmass;
-  float sky;
-  float bias;
-  float fwhm;
-
-  float telfocus;
-  float xprobe, yprobe, zprobe;
-  float dettemp;
-  float teltemp[4];
-  float rotangle;
-  float ra, dec;
-
-  e_time obstime;
-  e_time regtime;
-} RegImage;  /* 360 bytes / image */
-
-# if (0)
-/* Detrend Database structure */
-typedef struct {
-  e_time tstart;
-  e_time tstop;
-  e_time treg;
-  float exptime;
-  int type;
-  int filter;
-  int ccd;
-  int Nentry;
-  int Norder;
-  char mode;
-  char altpath;   /* true: data on alt db paths */
-  char dummy[58]; /* for future expansion */
-  char label[64];
-  char filename[256];
-} DetReg;    /* 416 bytes */
-# endif
 
 /* average data as stored in the LONEOS database -- must be translated on load */
@@ -91,36 +42,17 @@
 } SecFilt; /* 6 byte / SecFilt */
 
-/* image structure for binary data storage of image data */
 typedef struct {
-  Coords         coords;            /* 120 bytes */
-  unsigned int   tzero;             /* readout time row 0 in sec (0 - 142 years valid range) */
-  unsigned int   nstar;             /* number of stars on image */
-  short int      secz;              /* thousanths of airmass (valid range -32.000 -- 32.000) */
-  short int      NX, NY;            /* dimensions of image */
-  short int      apmifit, dapmifit; /* aperture correction and error in thousandths of mag */
-  short int      source;            /* identifier for CCD (each ever used will have a unique letter) */
-  short int      Mcal;              /* thousandths of mag (-32.000 -- 32.000 valid range) */
-  short int      dMcal;             /* thousandths of mag (-32.000 -- 32.000 valid range) */
-  short int      Xm;                /* 10*log(image chi-square) */
-  char           name[32];          /* name of original image */
-  unsigned char  detection_limit;   /* tenths of mag (0.0 - 25.6 valid range) */
-  unsigned char  saturation_limit;  /* tenths of mag (0.0 - 25.6 valid range) */
-  unsigned char  cerror;            /* astrometric error: 1/50 of arcsec (0 -- 5.12 valid range) */
-  unsigned char  fwhm_x, fwhm_y;    /* PSF terms in 25*arcsec (valid range 0.0 -- 10.2" ") */
-  unsigned char  trate;             /* 10000 * scan rate in sec/pix (0 -- 0.0256 valid range, 
-				       typically 0.0146. this is used only to determine the time
-				       of the observation, not to find the coordinates.  1 byte
-				       gives 0.11 sec accuracy */
-  float          exptime;           /* exposure time, seconds */
-  char           code;              /* flag to mark an image as bad or whatever */
-  unsigned char  ccdnum;            /* mosaic CCD ID number (IMAGEID) */ 
-  char           dummy[20];         /* extra space for the future */
-  short int      order;             /* number of terms used for Mrel */
-  short int      Mx, My;
-  short int      Mxx, Mxy, Myy;
-  short int      Mxxx, Mxxy, Mxyy, Myyy;
-  short int      Mxxxx, Mxxxy, Mxxyy, Mxyyy, Myyyy;
-} Image;  /* 240 bytes / Image */
-/* Image needs to be aligned with 8-byte boundaries on Suns */
+  unsigned short int code;   /* code number (stored in Measure.source) */
+  char name[32];             /* name for filter combination */
+  char type;                 /* primary, secondary, dependent, reference */
+  short int C, dC, dX;       /* primary phot calibration terms (millimags) */
+  float K;                   /* secondary phot calibration terms (millimags) */
+  int  c1, c2;               /* color is average.M[c1] - average.M[c2] */
+  int  equiv;                /* this dependent filter is equivalent to equiv primary/secondary */
+  int  Nc;                   /* number of color terms */
+  float X[4];                /* color terms X[0]*mc + X[1]*mc^2 + X[2]*mc^3, etc */
+} PhotCode;
+
+/************  end of database structures ************************************/
 
 /* a catalog contains this data */
@@ -150,16 +82,4 @@
   double DEC[2], RA[2];
 } GSCRegion;
-
-typedef struct {
-  unsigned short int code;   /* code number (stored in Measure.source) */
-  char name[32];             /* name for filter combination */
-  char type;                 /* primary, secondary, dependent, reference */
-  short int C, dC, dX;       /* primary phot calibration terms (millimags) */
-  float K;                   /* secondary phot calibration terms (millimags) */
-  int  c1, c2;               /* color is average.M[c1] - average.M[c2] */
-  int  equiv;                /* this dependent filter is equivalent to equiv primary/secondary */
-  int  Nc;                   /* number of color terms */
-  float X[4];                /* color terms X[0]*mc + X[1]*mc^2 + X[2]*mc^3, etc */
-} PhotCode;
 
 typedef struct {
