Index: /trunk/Ohana/src/libautocode/Makefile
===================================================================
--- /trunk/Ohana/src/libautocode/Makefile	(revision 4018)
+++ /trunk/Ohana/src/libautocode/Makefile	(revision 4019)
@@ -29,4 +29,5 @@
 # remember to add entries here to libohana/Makefile:AOBJ as well
 LIBOBJ = \
+$(SRC)/image.$(ARCH).o \
 $(SRC)/regimage.$(ARCH).o \
 $(SRC)/detreg.$(ARCH).o \
@@ -38,4 +39,5 @@
 
 LIBINC = \
+$(INC)/image.h \
 $(INC)/regimage.h \
 $(INC)/detreg.h \
Index: /trunk/Ohana/src/libautocode/def/autocode.c
===================================================================
--- /trunk/Ohana/src/libautocode/def/autocode.c	(revision 4018)
+++ /trunk/Ohana/src/libautocode/def/autocode.c	(revision 4019)
@@ -59,2 +59,13 @@
   return (TRUE);
 }
+
+int fits_table_mkheader_$STRUCT (Header *header) {
+
+  /* create table header */
+  fits_create_table_header (header, "$TYPE", "$EXTNAME");
+
+  /* define table layout */
+  /** TABLE DEFINITION **/
+
+  return (TRUE);
+}
Index: /trunk/Ohana/src/libautocode/def/image.d
===================================================================
--- /trunk/Ohana/src/libautocode/def/image.d	(revision 4019)
+++ /trunk/Ohana/src/libautocode/def/image.d	(revision 4019)
@@ -0,0 +1,61 @@
+STRUCT Image
+EXTNAME DVO_IMAGES
+TYPE BINTABLE
+SIZE 240
+
+# elements of the image structure
+
+TYPE  coords,               COORDS,               Coords         astrometric data
+FIELD tzero,                TZERO,                e_time         readout time (row 0)
+FIELD nstar,                NSTAR,                unsigned int   number of stars on image 
+FIELD secz,                 SECZ,                 short int      airmass,                   milliairmass
+FIELD NX,                   NX,                   short int      image width
+FIELD NY,                   NY,                   short int      image height
+FIELD apmifit,              APMIFIT,              short int      aperture correction,       millimag
+FIELD dapmifit,             DAPMIFIT,             short int      apmifit error,             millimag 
+FIELD source,               SOURCE,               short int      identifier for CCD
+FIELD Mcal,                 MCAL,                 short int      millimag
+FIELD dMcal,                DMCAL,                short int      millimag
+FIELD Xm,                   XM,                   short int      10*log(image chi-square) 
+FIELD name,                 NAME,                 char[32]       name of original image 
+FIELD detection_limit,      DETECTION_LIMIT,      unsigned char  detection limit,           10*mag
+FIELD saturation_limit,     SATURATION_LIMIT,     unsigned char  saturation limit,          10*mag
+FIELD cerror,               CERROR,               unsigned char  astrometric error,         50*arcsec
+FIELD fwhm_x                FWHM_X                unsigned char  PSF x width,               25*arcsec
+FIELD fwhm_y,               FWHM_Y,               unsigned char  PSF y width,               25*arcsec
+FIELD trate,                TRATE,                unsigned char  scan rate,                 100 usec/pixel 
+FIELD exptime,              EXPTIME,              float          exposure time,             seconds
+FIELD code,                 CODE,                 char           image quality flag
+FIELD ccdnum,               CCDNUM,               unsigned char  CCD ID number
+FIELD dummy,                DUMMY,                char[20]       unused
+FIELD order,                ORDER,                short int      Mrel 2D polynomical order 
+FIELD Mx,                   MX,                   short int      Mrel polyterm
+FIELD My,                   MY,                   short int      Mrel polyterm
+FIELD Mxx                   MXX                   short int      Mrel polyterm
+FIELD Mxy                   MXY                   short int      Mrel polyterm
+FIELD Myy,                  MYY,                  short int      Mrel polyterm
+FIELD Mxxx                  MXXX                  short int      Mrel polyterm
+FIELD Mxxy                  MXXY                  short int      Mrel polyterm
+FIELD Mxyy                  MXYY                  short int      Mrel polyterm
+FIELD Myyy,                 MYYY,                 short int      Mrel polyterm
+FIELD Mxxxx                 MXXXX                 short int      Mrel polyterm
+FIELD Mxxxy                 MXXXY                 short int      Mrel polyterm
+FIELD Mxxyy                 MXXYY                 short int      Mrel polyterm
+FIELD Mxyyy                 MXYYY                 short int      Mrel polyterm
+FIELD Myyyy,                MYYYY,                short int      Mrel polyterm
+
+TYPE  Coords
+FIELD crval1                CRVAL1                double   
+FIELD crval2                CRVAL2                double   
+FIELD crpix1                CRPIX1                float    
+FIELD crpix2                CRPIX2                float    
+FIELD cdelt1                CDELT1                float    
+FIELD cdelt2                CDELT2                float    
+FIELD pc1_1                 PC1_1                 float    
+FIELD pc1_2                 PC1_2                 float    
+FIELD pc2_1                 PC2_1                 float    
+FIELD pc2_2                 PC2_2                 float    
+FIELD polyterms[7][2]       POLYTERMS[7][2]       float    
+FIELD ctype[15]             CTYPE[15]             char     
+FIELD Npolyterms            NPOLYTERMS            char     
+END
Index: /trunk/Ohana/src/libautocode/def/spectrum-ascii.d
===================================================================
--- /trunk/Ohana/src/libautocode/def/spectrum-ascii.d	(revision 4018)
+++ /trunk/Ohana/src/libautocode/def/spectrum-ascii.d	(revision 4019)
@@ -28,2 +28,12 @@
 FIELD state,      STATE,      int[2],      raw/wav/flx/etc,       
 FIELD flag,       FLAG,       int[3],      status flags,          
+
+FIELD obstime,    START_TIME, char[20],    start time of measurement, yyyy/mm/dd,hh:mm:ss
+FIELD filter,  	  FILTER,     char[10],    filter and camera name    
+FIELD ZP,      	  ZP_OBS,     float[8.4],  measured zero point,       mag
+FIELD dZP,     	  ZP_ERR,     float[7.4],  error on zero point,       mag
+FIELD ra,      	  RA,         float[11.6], RA (J2000),                dec. degrees
+FIELD dec,     	  DEC,        float[11.6], DEC (J2000),               dec. degrees
+FIELD airmass, 	  C_AIRMASS,  float[7.3],  airmass coeff,             mag per airmass 
+FIELD sky,     	  SKY,        float[7.1],  median sky flux,           counts
+FIELD Nstar,   	  NSTAR,      int[6],      Number of stars in image,  stars
Index: /trunk/Ohana/src/libautocode/generate
===================================================================
--- /trunk/Ohana/src/libautocode/generate	(revision 4018)
+++ /trunk/Ohana/src/libautocode/generate	(revision 4019)
@@ -185,4 +185,5 @@
 	}
 	# this is a patch for old photreg tables: provide a fix for the tables
+	# some photreg tables were not byteswapped for certain columns
 	if ($type eq "rawshort")  {
 	    $N +=2;
