Index: trunk/Ohana/src/libautocode/Makefile
===================================================================
--- trunk/Ohana/src/libautocode/Makefile	(revision 4865)
+++ trunk/Ohana/src/libautocode/Makefile	(revision 5014)
@@ -29,4 +29,5 @@
 $(SRC)/average-panstarrs.$(ARCH).o \
 $(SRC)/secfilt.$(ARCH).o \
+$(SRC)/secfilt-loneos.$(ARCH).o \
 $(SRC)/secfilt-elixir.$(ARCH).o \
 $(SRC)/secfilt-panstarrs.$(ARCH).o \
@@ -38,4 +39,7 @@
 $(SRC)/photcode.$(ARCH).o \
 $(SRC)/image.$(ARCH).o \
+$(SRC)/image-loneos.$(ARCH).o \
+$(SRC)/image-elixir.$(ARCH).o \
+$(SRC)/image-panstarrs.$(ARCH).o \
 $(SRC)/regimage.$(ARCH).o \
 $(SRC)/detreg.$(ARCH).o \
@@ -53,4 +57,5 @@
 $(INC)/average-panstarrs.h \
 $(INC)/secfilt.h \
+$(INC)/secfilt-loneos.h \
 $(INC)/secfilt-elixir.h \
 $(INC)/secfilt-panstarrs.h \
@@ -62,4 +67,7 @@
 $(INC)/photcode.h \
 $(INC)/image.h \
+$(INC)/image-loneos.h \
+$(INC)/image-elixir.h \
+$(INC)/image-panstarrs.h \
 $(INC)/regimage.h \
 $(INC)/detreg.h \
Index: trunk/Ohana/src/libautocode/def/average-panstarrs.d
===================================================================
--- trunk/Ohana/src/libautocode/def/average-panstarrs.d	(revision 4865)
+++ trunk/Ohana/src/libautocode/def/average-panstarrs.d	(revision 5014)
@@ -2,5 +2,5 @@
 EXTNAME DVO_AVERAGE_PANSTARRS
 TYPE    BINTABLE
-SIZE    44
+SIZE    48
 
 # elements of data structure / FITS table
@@ -18,2 +18,3 @@
 FIELD offset,         offset,     int,     	    offset to first measurement
 FIELD missing,        missing,    int,     	    offset to first missing obs
+FIELD dummy,          dummmy,     int,              extra space
Index: trunk/Ohana/src/libautocode/def/image-ascii.d
===================================================================
--- trunk/Ohana/src/libautocode/def/image-ascii.d	(revision 5014)
+++ trunk/Ohana/src/libautocode/def/image-ascii.d	(revision 5014)
@@ -0,0 +1,16 @@
+# name of structure type
+STRUCT  ImageASCII
+EXTNAME IMAGE
+TYPE    TABLE
+SIZE    328
+
+# elements of data structure / FITS table
+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/def/image-elixir.d
===================================================================
--- trunk/Ohana/src/libautocode/def/image-elixir.d	(revision 5014)
+++ trunk/Ohana/src/libautocode/def/image-elixir.d	(revision 5014)
@@ -0,0 +1,59 @@
+STRUCT  ImageElixir
+EXTNAME DVO_IMAGE_ELIXIR
+TYPE 	BINTABLE
+SIZE 	240
+
+# elements of the image structure
+
+SUBSTRUCT coords,           COORDS,               Coords,        astrometric data
+SUBFIELD  crval1,           CRVAL1,               double,   	 coordinate at reference pixel
+SUBFIELD  crval2,           CRVAL2,               double,  	 coordinate at reference pixel
+SUBFIELD  crpix1,           CRPIX1,               float,   	 coordinate of reference pixel
+SUBFIELD  crpix2,           CRPIX2,               float,   	 coordinate of reference pixel
+SUBFIELD  cdelt1,           CDELT1,               float,   	 degrees per pixel
+SUBFIELD  cdelt2,           CDELT2,               float,    	 degrees per pixel
+SUBFIELD  pc1_1,            PC1_1,                float,    	 rotation matrix
+SUBFIELD  pc1_2,            PC1_2,                float,    	 rotation matrix
+SUBFIELD  pc2_1,            PC2_1,                float,    	 rotation matrix
+SUBFIELD  pc2_2,            PC2_2,                float,    	 rotation matrix
+SUBFIELD  polyterms,        POLYTERMS,            float[7][2],	 higher order warping terms
+SUBFIELD  ctype,            CTYPE,                char[15],      coordinate type
+SUBFIELD  Npolyterms,       NPOLYTERMS,           char,     	 order of polynomial
+
+FIELD 	  tzero,            TZERO,                e_time,         readout time (row 0)
+FIELD 	  nstar,            NSTAR,                unsigned int,   number of stars on image
+FIELD 	  secz,             SECZ,                 short,      	  airmass,                   milliairmass
+FIELD 	  NX,               NX,                   short,      	  image width
+FIELD 	  NY,               NY,                   short,      	  image height
+FIELD 	  apmifit,          APMIFIT,              short,      	  aperture correction,       millimag
+FIELD 	  dapmifit,         DAPMIFIT,             short,      	  apmifit error,             millimag
+FIELD 	  source,           SOURCE,               short,      	  identifier for CCD,
+FIELD 	  Mcal,             MCAL,                 short,      	  calibration mag,           millimag
+FIELD 	  dMcal,            DMCAL,                short,      	  error on Mcal,             millimag
+FIELD 	  Xm,               XM,                   short,      	  image chisq,               10*log(value)
+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,      	  Mrel 2D polynomical order 
+FIELD 	  Mx,               MX,                   short,      	  Mrel polyterm
+FIELD 	  My,               MY,                   short,      	  Mrel polyterm
+FIELD 	  Mxx,              MXX,                  short,      	  Mrel polyterm
+FIELD 	  Mxy,              MXY,                  short,      	  Mrel polyterm
+FIELD 	  Myy,              MYY,                  short,      	  Mrel polyterm
+FIELD 	  Mxxx,             MXXX,                 short,      	  Mrel polyterm
+FIELD 	  Mxxy,             MXXY,                 short,      	  Mrel polyterm
+FIELD 	  Mxyy,             MXYY,                 short,      	  Mrel polyterm
+FIELD 	  Myyy,             MYYY,                 short,      	  Mrel polyterm
+FIELD 	  Mxxxx,            MXXXX,                short,      	  Mrel polyterm
+FIELD 	  Mxxxy,            MXXXY,                short,      	  Mrel polyterm
+FIELD 	  Mxxyy,            MXXYY,                short,      	  Mrel polyterm
+FIELD 	  Mxyyy,            MXYYY,                short,      	  Mrel polyterm
+FIELD 	  Myyyy,            MYYYY,                short,      	  Mrel polyterm
Index: trunk/Ohana/src/libautocode/def/image-loneos.d
===================================================================
--- trunk/Ohana/src/libautocode/def/image-loneos.d	(revision 5014)
+++ trunk/Ohana/src/libautocode/def/image-loneos.d	(revision 5014)
@@ -0,0 +1,59 @@
+STRUCT  ImageLoneos
+EXTNAME DVO_IMAGE_LONEOS
+TYPE 	BINTABLE
+SIZE 	240
+
+# elements of the image structure
+
+SUBSTRUCT coords,           COORDS,               Coords,        astrometric data
+SUBFIELD  crval1,           CRVAL1,               double,   	 coordinate at reference pixel
+SUBFIELD  crval2,           CRVAL2,               double,  	 coordinate at reference pixel
+SUBFIELD  crpix1,           CRPIX1,               float,   	 coordinate of reference pixel
+SUBFIELD  crpix2,           CRPIX2,               float,   	 coordinate of reference pixel
+SUBFIELD  cdelt1,           CDELT1,               float,   	 degrees per pixel
+SUBFIELD  cdelt2,           CDELT2,               float,    	 degrees per pixel
+SUBFIELD  pc1_1,            PC1_1,                float,    	 rotation matrix
+SUBFIELD  pc1_2,            PC1_2,                float,    	 rotation matrix
+SUBFIELD  pc2_1,            PC2_1,                float,    	 rotation matrix
+SUBFIELD  pc2_2,            PC2_2,                float,    	 rotation matrix
+SUBFIELD  polyterms,        POLYTERMS,            float[7][2],	 higher order warping terms
+SUBFIELD  ctype,            CTYPE,                char[15],      coordinate type
+SUBFIELD  Npolyterms,       NPOLYTERMS,           char,     	 order of polynomial
+
+FIELD 	  tzero,            TZERO,                e_time,         readout time (row 0)
+FIELD 	  nstar,            NSTAR,                unsigned int,   number of stars on image
+FIELD 	  secz,             SECZ,                 short,      	  airmass,                   milliairmass
+FIELD 	  NX,               NX,                   short,      	  image width
+FIELD 	  NY,               NY,                   short,      	  image height
+FIELD 	  apmifit,          APMIFIT,              short,      	  aperture correction,       millimag
+FIELD 	  dapmifit,         DAPMIFIT,             short,      	  apmifit error,             millimag
+FIELD 	  source,           SOURCE,               short,      	  identifier for CCD,
+FIELD 	  Mcal,             MCAL,                 short,      	  calibration mag,           millimag
+FIELD 	  dMcal,            DMCAL,                short,      	  error on Mcal,             millimag
+FIELD 	  Xm,               XM,                   short,      	  image chisq,               10*log(value)
+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,      	  Mrel 2D polynomical order 
+FIELD 	  Mx,               MX,                   short,      	  Mrel polyterm
+FIELD 	  My,               MY,                   short,      	  Mrel polyterm
+FIELD 	  Mxx,              MXX,                  short,      	  Mrel polyterm
+FIELD 	  Mxy,              MXY,                  short,      	  Mrel polyterm
+FIELD 	  Myy,              MYY,                  short,      	  Mrel polyterm
+FIELD 	  Mxxx,             MXXX,                 short,      	  Mrel polyterm
+FIELD 	  Mxxy,             MXXY,                 short,      	  Mrel polyterm
+FIELD 	  Mxyy,             MXYY,                 short,      	  Mrel polyterm
+FIELD 	  Myyy,             MYYY,                 short,      	  Mrel polyterm
+FIELD 	  Mxxxx,            MXXXX,                short,      	  Mrel polyterm
+FIELD 	  Mxxxy,            MXXXY,                short,      	  Mrel polyterm
+FIELD 	  Mxxyy,            MXXYY,                short,      	  Mrel polyterm
+FIELD 	  Mxyyy,            MXYYY,                short,      	  Mrel polyterm
+FIELD 	  Myyyy,            MYYYY,                short,      	  Mrel polyterm
Index: trunk/Ohana/src/libautocode/def/image-panstarrs.d
===================================================================
--- trunk/Ohana/src/libautocode/def/image-panstarrs.d	(revision 5014)
+++ trunk/Ohana/src/libautocode/def/image-panstarrs.d	(revision 5014)
@@ -0,0 +1,65 @@
+STRUCT  ImagePanstarrs
+EXTNAME DVO_IMAGE_PANSTARRS
+TYPE    BINTABLE
+SIZE    248
+
+# elements of the image structure
+
+SUBSTRUCT coords,           COORDS,               Coords,        astrometric data
+SUBFIELD  crval1,           CRVAL1,               double,   	 coordinate at reference pixel
+SUBFIELD  crval2,           CRVAL2,               double,  	 coordinate at reference pixel
+SUBFIELD  crpix1,           CRPIX1,               float,   	 coordinate of reference pixel
+SUBFIELD  crpix2,           CRPIX2,               float,   	 coordinate of reference pixel
+SUBFIELD  cdelt1,           CDELT1,               float,   	 degrees per pixel
+SUBFIELD  cdelt2,           CDELT2,               float,    	 degrees per pixel
+SUBFIELD  pc1_1,            PC1_1,                float,    	 rotation matrix
+SUBFIELD  pc1_2,            PC1_2,                float,    	 rotation matrix
+SUBFIELD  pc2_1,            PC2_1,                float,    	 rotation matrix
+SUBFIELD  pc2_2,            PC2_2,                float,    	 rotation matrix
+SUBFIELD  polyterms,        POLYTERMS,            float[7][2],	 higher order warping terms
+SUBFIELD  ctype,            CTYPE,                char[15],      coordinate type
+SUBFIELD  Npolyterms,       NPOLYTERMS,           char,     	 order of polynomial
+# 120 bytes
+
+FIELD 	  tzero,            TZERO,                e_time,         readout time (row 0)
+FIELD 	  nstar,            NSTAR,                unsigned int,   number of stars on image
+FIELD 	  secz,             SECZ,                 float,      	  airmass,                   mag
+FIELD 	  NX,               NX,                   short,      	  image width
+FIELD 	  NY,               NY,                   short,      	  image height
+FIELD 	  apmifit,          APMIFIT,              float,      	  aperture correction,       mag
+FIELD 	  dapmifit,         DAPMIFIT,             float,      	  apmifit error,             mag
+FIELD 	  Mcal,             MCAL,                 float,      	  calibration mag,           mag
+FIELD 	  dMcal,            DMCAL,                float,      	  error on Mcal,             mag
+FIELD 	  Xm,               XM,                   short,      	  image chisq,               10*log(value)
+FIELD 	  source,           SOURCE,               short,      	  identifier for CCD,
+FIELD 	  exptime,          EXPTIME,              float,          exposure time,             seconds
+# 40 bytes
+
+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 	  code,             CODE,                 char,           image quality flag
+FIELD 	  ccdnum,           CCDNUM,               unsigned char,  CCD ID number
+# 40 bytes 
+
+FIELD 	  dummy,            DUMMY,                char[18],       unused
+FIELD 	  order,            ORDER,                short,      	  Mrel 2D polynomical order 
+FIELD 	  Mx,               MX,                   short,      	  Mrel polyterm
+FIELD 	  My,               MY,                   short,      	  Mrel polyterm
+FIELD 	  Mxx,              MXX,                  short,      	  Mrel polyterm
+FIELD 	  Mxy,              MXY,                  short,      	  Mrel polyterm
+FIELD 	  Myy,              MYY,                  short,      	  Mrel polyterm
+FIELD 	  Mxxx,             MXXX,                 short,      	  Mrel polyterm
+FIELD 	  Mxxy,             MXXY,                 short,      	  Mrel polyterm
+FIELD 	  Mxyy,             MXYY,                 short,      	  Mrel polyterm
+FIELD 	  Myyy,             MYYY,                 short,      	  Mrel polyterm
+FIELD 	  Mxxxx,            MXXXX,                short,      	  Mrel polyterm
+FIELD 	  Mxxxy,            MXXXY,                short,      	  Mrel polyterm
+FIELD 	  Mxxyy,            MXXYY,                short,      	  Mrel polyterm
+FIELD 	  Mxyyy,            MXYYY,                short,      	  Mrel polyterm
+FIELD 	  Myyyy,            MYYYY,                short,      	  Mrel polyterm
+# 48 bytes
Index: trunk/Ohana/src/libautocode/def/image.d
===================================================================
--- trunk/Ohana/src/libautocode/def/image.d	(revision 4865)
+++ trunk/Ohana/src/libautocode/def/image.d	(revision 5014)
@@ -1,6 +1,6 @@
-STRUCT Image
-EXTNAME DVO_IMAGES
-TYPE BINTABLE
-SIZE 240
+STRUCT  Image
+EXTNAME DVO_IMAGE
+TYPE    BINTABLE
+SIZE    248
 
 # elements of the image structure
@@ -20,16 +20,20 @@
 SUBFIELD  ctype,            CTYPE,                char[15],      coordinate type
 SUBFIELD  Npolyterms,       NPOLYTERMS,           char,     	 order of polynomial
+# 120 bytes
 
 FIELD 	  tzero,            TZERO,                e_time,         readout time (row 0)
 FIELD 	  nstar,            NSTAR,                unsigned int,   number of stars on image
-FIELD 	  secz,             SECZ,                 short,      	  airmass,                   milliairmass
+FIELD 	  secz_PS,          SECZ,                 float,      	  airmass,                   mag
 FIELD 	  NX,               NX,                   short,      	  image width
 FIELD 	  NY,               NY,                   short,      	  image height
-FIELD 	  apmifit,          APMIFIT,              short,      	  aperture correction,       millimag
-FIELD 	  dapmifit,         DAPMIFIT,             short,      	  apmifit error,             millimag
+FIELD 	  apmifit_PS,       APMIFIT,              float,      	  aperture correction,       mag
+FIELD 	  dapmifit_PS,      DAPMIFIT,             float,      	  apmifit error,             mag
+FIELD 	  Mcal_PS,          MCAL,                 float,      	  calibration mag,           mag
+FIELD 	  dMcal_PS,         DMCAL,                float,      	  error on Mcal,             mag
+FIELD 	  Xm,               XM,                   short,      	  image chisq,               10*log(value)
 FIELD 	  source,           SOURCE,               short,      	  identifier for CCD,
-FIELD 	  Mcal,             MCAL,                 short,      	  calibration mag,           millimag
-FIELD 	  dMcal,            DMCAL,                short,      	  error on Mcal,             millimag
-FIELD 	  Xm,               XM,                   short,      	  image chisq,               10*log(value)
+FIELD 	  exptime,          EXPTIME,              float,          exposure time,             seconds
+# 40 bytes
+
 FIELD 	  name,             NAME,                 char[32],       name of original image 
 FIELD 	  detection_limit,  DETECTION_LIMIT,      unsigned char,  detection limit,           10*mag
@@ -39,8 +43,9 @@
 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
+# 40 bytes 
+
+FIELD 	  dummy,            DUMMY,                char[18],       unused
 FIELD 	  order,            ORDER,                short,      	  Mrel 2D polynomical order 
 FIELD 	  Mx,               MX,                   short,      	  Mrel polyterm
@@ -58,2 +63,3 @@
 FIELD 	  Mxyyy,            MXYYY,                short,      	  Mrel polyterm
 FIELD 	  Myyyy,            MYYYY,                short,      	  Mrel polyterm
+# 48 bytes
Index: trunk/Ohana/src/libautocode/def/measure-panstarrs.d
===================================================================
--- trunk/Ohana/src/libautocode/def/measure-panstarrs.d	(revision 4865)
+++ trunk/Ohana/src/libautocode/def/measure-panstarrs.d	(revision 5014)
@@ -2,5 +2,5 @@
 EXTNAME DVO_MEASURE_PANSTARRS
 TYPE    BINTABLE
-SIZE    50
+SIZE    52
 
 # elements of data structure / FITS table
@@ -20,4 +20,5 @@
 FIELD source,         source,     unsigned short, photcode
 FIELD flags,          flags,      unsigned short, flags for various uses  
+FIELD dummy,          dummy,      short,          extra space
 FIELD t,              t,          unsigned int,   time in seconds (UNIX)
 FIELD averef,         averef,     unsigned int,   reference to average entry      
Index: trunk/Ohana/src/libautocode/def/secfilt-loneos.d
===================================================================
--- trunk/Ohana/src/libautocode/def/secfilt-loneos.d	(revision 5014)
+++ trunk/Ohana/src/libautocode/def/secfilt-loneos.d	(revision 5014)
@@ -0,0 +1,8 @@
+STRUCT  SecFiltLoneos
+EXTNAME DVO_SECFILT_LONEOS
+TYPE    BINTABLE
+SIZE    4
+
+# elements of data structure / FITS table
+FIELD  M,  MAG,      short,                other mags,       millimags
+FIELD  Xm, MAG_CHI,  short,                chisq on mag
Index: trunk/Ohana/src/libautocode/def/secfilt-panstarrs.d
===================================================================
--- trunk/Ohana/src/libautocode/def/secfilt-panstarrs.d	(revision 4865)
+++ trunk/Ohana/src/libautocode/def/secfilt-panstarrs.d	(revision 5014)
@@ -2,8 +2,9 @@
 EXTNAME DVO_SECFILT_PANSTARRS
 TYPE    BINTABLE
-SIZE    8
+SIZE    12
 
 # elements of data structure / FITS table
 FIELD  M,  MAG,      float,                other mags,       mags
-FIELD  dM, MAG_ERR,  short,                scatter on mag    1e4*mag
+FIELD  dM, MAG_ERR,  float,                scatter on mag    1e4*mag
 FIELD  Xm, MAG_CHI,  short,                chisq on mag,     [100*log(value)]
+FIELD  dummy, JUNK,  short,                chisq on mag,     [100*log(value)]
Index: trunk/Ohana/src/libautocode/def/secfilt.d
===================================================================
--- trunk/Ohana/src/libautocode/def/secfilt.d	(revision 4865)
+++ trunk/Ohana/src/libautocode/def/secfilt.d	(revision 5014)
@@ -2,5 +2,5 @@
 EXTNAME DVO_SECFILT
 TYPE    BINTABLE
-SIZE    10
+SIZE    12
 
 # elements of data structure / FITS table
@@ -8,2 +8,3 @@
 FIELD  dM_PS, MAG_ERR,  float,                scatter on mag    mags
 FIELD  Xm,    MAG_CHI,  short,                chisq on mag      [100*log(value)]
+FIELD  dummy, JUNK,     short,                place holder
Index: trunk/Ohana/src/libautocode/generate
===================================================================
--- trunk/Ohana/src/libautocode/generate	(revision 4865)
+++ trunk/Ohana/src/libautocode/generate	(revision 5014)
@@ -35,10 +35,16 @@
 	($key, $value) = split (" ", $line, 2);
 	
+	# strip white space from the following
+	if ($key eq "TYPE")    { ($value) = $value =~ m|\s*(\S+)\s*|; }
+	if ($key eq "SIZE")    { ($value) = $value =~ m|\s*(\S+)\s*|; }
+	if ($key eq "STRUCT")  { ($value) = $value =~ m|\s*(\S+)\s*|; }
+	if ($key eq "EXTNAME") { ($value) = $value =~ m|\s*(\S+)\s*|; }
+
 	&set_keypair ($key, $value);
 
 	# there are used internally (not just a replacement)
-	if ($key eq "TYPE")   { $TYPE = $value;   }
-	if ($key eq "SIZE")   { $SIZE = $value;   }
-	if ($key eq "STRUCT") { $STRUCT = $value; }
+	if ($key eq "TYPE")    { $TYPE = $value;   }
+	if ($key eq "SIZE")    { $SIZE = $value;   }
+	if ($key eq "STRUCT")  { $STRUCT = $value; }
 
 	# not a simple key/value entry
@@ -54,6 +60,8 @@
 	}
     }
+    $Nexpect = 0;
     if ($TYPE eq "BINTABLE") { $Nexpect = &count_bintablesize; }
     if ($TYPE eq "TABLE")    { $Nexpect = &count_tablesize;    }
+    if (! $Nexpect) { die "missing valid TYPE\n"; }
     if ($Nexpect != $SIZE) { die "size mismatch: $Nexpect vs $SIZE\n"; }
 }
