Index: trunk/Ohana/src/libohana/include/loneos.h
===================================================================
--- trunk/Ohana/src/libohana/include/loneos.h	(revision 3402)
+++ trunk/Ohana/src/libohana/include/loneos.h	(revision 3466)
@@ -18,26 +18,6 @@
 enum {M_UNDEF = -1, M_NONE, M_MEF, M_SPLIT, M_SINGLE, M_CUBE, M_SLICE, M_MODES, N_MODE};
 
-# if (0) 
-  # define MODE_NONE   0  /* not defined */
-  # define MODE_MEF    1  /* chip of mef image */
-  # define MODE_SPLIT  2  /* chip of split image */
-  # define MODE_SINGLE 3  /* single chip, not mosaic */
-  # define MODE_CUBE   4  /* cube entry */
-  # define MODE_SLICE  5  /* slice of a cube */
-  # define MODE_MODES  6  /* not used? */
-
-  # define TYPE_NONE   0
-  # define TYPE_OBJECT 1
-  # define TYPE_DARK   2
-  # define TYPE_BIAS   3
-  # define TYPE_FLAT   4
-/** these are no longer used by imregister-3.0 
-    status:imrough uses the imregister-3.0 values
-    status:imsearch should migrate to the imregister.h version 
-    or be removed!
-**/
-# endif
-
-
+/* convert these to enums? */
+/* RegImage.flag values */
 # define IMREG_DIST  0x01 /* image distributed, only imregister-3.0 */
 
@@ -101,10 +81,4 @@
       than one star in the catalog, but not in the same catalog file.
 */
-
-/* structure for data on a catalog region */
-typedef struct {
-  char filename[256];
-  double DEC[2], RA[2];
-} GSCRegion;
 
 /* structure for Image Registration Database */
@@ -137,30 +111,4 @@
 } RegImage;  /* 360 bytes / image */
 
-/* structure for Image Registration Database */
-typedef struct {
-  float sky;
-  float bias;
-  float fwhm;
-  float exptime;
-  float airmass;
-  e_time obstime;
-  short int ccdnum;
-  char junk1, junk2;
-  char filter[32];
-} RufImage;  /* 60 bytes */
-
-/* Old Detrend Database structure */
-typedef struct {
-  e_time tstart;
-  e_time tstop;
-  e_time treg;
-  float sigma, clipsigma;
-  int type;
-  int filter;
-  int ccd;
-  char filename[254];
-  char flag1, flag2;
-} DetRegOld;    /* 288 bytes */
-
 /* Detrend Database structure */
 typedef struct {
@@ -193,19 +141,4 @@
   short int c2;               /* photcode for color term */
   short int photcode;         /* appropriate photcode */
-  char label[66];
-} OldPhotPars;    /* 100 bytes */
-
-/* Instant Zeropoint structure */
-typedef struct {
-  float ZP;                   /* measured zero point */
-  float ZPo;                  /* expected zero point */
-  float dZP;                  /* error on zero point */
-  float K;                    /* airmass term used */
-  float X;                    /* color term used */
-  e_time tstart;   /* start time of observation */
-  e_time tstop;    /* end time of observation */
-  short int c1;               /* photcode for color term */
-  short int c2;               /* photcode for color term */
-  short int photcode;         /* appropriate photcode */
   char label[64];
   short int refcode;          /* reference photometry system */
@@ -213,19 +146,4 @@
   int Nmeas;                  /* number of data points */
 } PhotPars;    /* 108 bytes */
-
-/* average data as stored in the LONEOS database */
-typedef struct {
-  float R;                    /* RA  in decimal degrees */
-  float D;                    /* DEC in decimal degrees */
-  short int M;                /* thousandths of mag (-32.000 to 32.000 valid range) */
-  unsigned short int Nm, Nn;  /* number of measurements, missing */
-  short int Xp;               /* scatter in 1/100 arcsec (-327.67 to +327.67 valid range) */
-  short int Xm;               /* chisq for primary mag [1000*value] */
-  unsigned short int code;    /* an ID code (ie, star, ghost, satelite, etc) */
-  signed int offset;          /* offset to first measurement */
-  signed int missing;         /* offset to first missing obs */
-  short int dM;               /* formal error on pri mag   [1000*log(value)] */
-  short int Xg;               /* 'best' chisq value */
-} Average; /* 32 bytes / Average */
 
 /* average data as stored in the LONEOS database -- must be translated on load */
@@ -240,10 +158,7 @@
   signed int offset;          /* offset to first measurement */
   signed int missing;         /* offset to first missing obs */
-} OldAverage; /* 28 bytes / Average */
+} Average; /* 28 bytes / Average */
 
 /* data for individual measurement for each star */
-/* OLD LONEOS VERSION.  NOT BYTE COMPATIBLE WITH NEW VERSION 
-   (can be loaded with translation, losing the exptime,
-   and limited the number of Naverage to 0xffffff - in load_catalog) */
 typedef struct {
   short int dR, dD;           /* 1/100 of arcsec (-327.67 to +327.67 valid range) */
@@ -255,39 +170,5 @@
   unsigned int   t;           /* time in seconds (0 - 143 years valid range) */
   unsigned int average;       /* reference to corresponding average entry, upper byte of Measure.average stores flags */
-} OldMeasure; /* 20 bytes / Measure */
-
-/* data for individual measurement for each star */
-typedef struct {
-  short int dR, dD;           /* 1/100 of arcsec (-327.67 to +327.67 valid range) */
-  short int M;                /* thousandths of mag (-32.767 to 32.767 valid range) */
-  short int Mcal;             /* image cal mag, thousandths of mag (-32.767 to 32.767 valid range) */
-  short int Mgal;             /* 'galaxy' mag, thousandths of mag (-32.767 to 32.767 valid range) */
-  short int airmass;          /* (airmass - 1), thousandths of mag (-32.767 to 32.767 valid range) */
-  short int FWx;              /* object fwhm major axis - 1/100 of arcsec */
-  unsigned char dM;           /* thousandths of mag (0.000 to 0.255 valid range) */
-  unsigned char fwy, theta;   /* object fwhm minor/major axes ratio, angle wrt ccd X dir (0xff/360 deg precision) */
-  char dophot;                /* dophot type (1-9) */
-  unsigned short int source;  /* code to identify photometry source */
-  unsigned int   t;           /* time in seconds (0 - 143 years valid range) */
-  unsigned int averef;        /* reference to corresponding average entry, upper byte of Measure.average stores flags */
-  short int dt;               /* exposure time in units of 2500*log(exptime) (millimags!) */
-  unsigned short int flags;   /* 16 bit-flags for various uses */ 
-} Measure; /* 32 bytes / Measure */
-
-# if (0)
-/* data for individual measurement for each star */
-typedef struct {
-  short int dR, dD;           /* 1/100 of arcsec (-327.67 to +327.67 valid range) */
-  short int M;                /* thousandths of mag (-32.767 to 32.767 valid range) */
-  short int Mcal;             /* image cal mag, thousandths of mag (-32.767 to 32.767 valid range) */
-  unsigned char dM;           /* thousandths of mag (0.000 to 0.255 valid range) */
-  char dophot;                /* dophot type (1-9) */
-  unsigned short int source;  /* code to identify photometry source */
-  unsigned int   t;           /* time in seconds (0 - 143 years valid range) */
-  unsigned int averef;        /* reference to corresponding average entry, upper byte of Measure.average stores flags */
-  short int dt;               /* exposure time in units of 2500*log(exptime) (millimags!) */
-  unsigned short int flags;   /* 16 bit-flags for various uses */ 
-} Measure; /* 24 bytes / Measure */
-# endif
+} Measure; /* 20 bytes / Measure */
 
 /* data on missing stars */
@@ -302,31 +183,4 @@
   short int dM;               /* scatter on alt mag */
 } SecFilt; /* 6 byte / SecFilt */
-
-/* data on missing stars */
-typedef struct {
-  short int M;                /* other mags - thousandths of mag (-32.767 to 32.767 valid range) */
-  short int Xm;               /* chisq on alt mag */
-} OldSecFilt; /* 4 byte / SecFilt */
-
-/* a catalog contains this data */
-typedef struct {
-  /* data in the file: */
-  Average *average;
-  Measure *measure; 
-  Missing *missing; 
-  SecFilt *secfilt;
-  Header  header;
-  int Naverage, Nmeasure, Nmissing, Nsecfilt;
-  /* description of the catalog file: */
-  char *filename;
-  int lockmode;
-  FILE *f;
-  /* pointers for data manipulation */
-  int *found;
-  int *image;
-  int *mosaic;
-  float *X;
-  float *Y;
-} Catalog;
 
 /* the standard astrometric coordinates structure */
@@ -341,24 +195,4 @@
   char     Npolyterms;
 } Coords;  /* 120 bytes / Coords */
-
-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 {
-  int Ncode;
-  int Nsecfilt;
-  int hashcode[0x10000];
-  int hashNsec[0x10000];
-  PhotCode *code;
-} PhotCodeData;
 
 /* image structure for binary data storage of image data */
@@ -395,4 +229,51 @@
 /* Image needs to be aligned with 8-byte boundaries on Suns */
 
+/* a catalog contains this data */
+typedef struct {
+  /* data in the file: */
+  Average *average;
+  Measure *measure; 
+  Missing *missing; 
+  SecFilt *secfilt;
+  Header  header;
+  int Naverage, Nmeasure, Nmissing, Nsecfilt;
+  /* description of the catalog file: */
+  char *filename;
+  int lockmode;
+  FILE *f;
+  /* pointers for data manipulation */
+  int *found;
+  int *image;
+  int *mosaic;
+  float *X;
+  float *Y;
+} Catalog;
+
+/* 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) */
+  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 {
+  int Ncode;
+  int Nsecfilt;
+  int hashcode[0x10000];
+  int hashNsec[0x10000];
+  PhotCode *code;
+} PhotCodeData;
+
 /**** prototypes ****/
 
