IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 2797


Ignore:
Timestamp:
Dec 23, 2004, 7:32:47 AM (22 years ago)
Author:
eugene
Message:

two important modifications:
1) added code for converting between mode/type names and codes (ie T_FLAT <-> 'flat')

this is synchronized with removing the same come from opihi.v2
(imsearch/detrend) and with major cleanup in the imregister
function. The imregister functions could not be built with -Wall
-Werror without this fix: they had been using static typename,
typecode, etc entries from imregister.h, which resulted in
complaints about unused variables.

2) added a new type 'e_time' to replace all 'unsigned long int'

previously used to store time values. the problem here is that the
database tables require a fixed byte size value regardless of
platform. the 64bit machines use 8 bytes for long int and for
time_t. isolating the e_time variable cleans this up. eventually
i'll need to replace all instances of the unsigned long int used as
a time variable with e_time.

Location:
trunk/Ohana/src/libohana
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libohana/Makefile

    r2510 r2797  
    2828$(SRC)/Fread.$(ARCH).o          $(SRC)/glockfile.$(ARCH).o       \
    2929$(SRC)/LoadPhotcodes.$(ARCH).o  $(SRC)/photfits.$(ARCH).o        \
    30 $(SRC)/phot_catalog.$(ARCH).o
     30$(SRC)/phot_catalog.$(ARCH).o   $(SRC)/imreg_datatypes.$(ARCH).o
    3131
    3232$(DESTLIB)/libohana.a: $(LIB)/libohana.$(ARCH).a
  • trunk/Ohana/src/libohana/include/loneos.h

    r2413 r2797  
     1
     2/*** this file uses data types which must have fixed sizes regardless
     3     of the platform.  It originally used the basic C primitives:
     4       float, double, int, short int, unsigned long int, etc.
     5     this breaks under 64 bit (and probably on other systems).
     6     I should define internal data types which should be set by the
     7     use of # define statements if needed.  I will cheat for now and use
     8     the time_t to replace unsigned long int in this file
     9***/
    110
    211# ifndef LONEOS_H
    312# define LONEOS_H
    413
     14# define e_time unsigned int
     15
    516/* image data modes in RegImage */
    6 # define MODE_NONE   0  /* not defined */
    7 # define MODE_MEF    1  /* chip of mef image */
    8 # define MODE_SPLIT  2  /* chip of split image */
    9 # define MODE_SINGLE 3  /* single chip, not mosaic */
    10 # define MODE_CUBE   4  /* cube entry */
    11 # define MODE_SLICE  5  /* slice of a cube */
    12 # define MODE_MODES  6  /* not used? */
    13 
    14 # define TYPE_NONE   0
    15 # define TYPE_OBJECT 1
    16 # define TYPE_DARK   2
    17 # define TYPE_BIAS   3
    18 # define TYPE_FLAT   4
    19 
     17enum {T_UNDEF = -1, T_NONE, T_OBJECT, T_DARK, T_BIAS, T_FLAT, T_MASK, T_FRINGE, T_SCATTER, T_MODES, T_FRINGEPTS, T_ANY, N_TYPE};
     18enum {M_UNDEF = -1, M_NONE, M_MEF, M_SPLIT, M_SINGLE, M_CUBE, M_SLICE, M_MODES, N_MODE};
     19
     20# if (0)
     21  # define MODE_NONE   0  /* not defined */
     22  # define MODE_MEF    1  /* chip of mef image */
     23  # define MODE_SPLIT  2  /* chip of split image */
     24  # define MODE_SINGLE 3  /* single chip, not mosaic */
     25  # define MODE_CUBE   4  /* cube entry */
     26  # define MODE_SLICE  5  /* slice of a cube */
     27  # define MODE_MODES  6  /* not used? */
     28
     29  # define TYPE_NONE   0
     30  # define TYPE_OBJECT 1
     31  # define TYPE_DARK   2
     32  # define TYPE_BIAS   3
     33  # define TYPE_FLAT   4
    2034/** these are no longer used by imregister-3.0
    2135    status:imrough uses the imregister-3.0 values
     
    2337    or be removed!
    2438**/
     39# endif
     40
    2541
    2642# define IMREG_DIST  0x01 /* image distributed, only imregister-3.0 */
     
    116132  float ra, dec;
    117133
    118   unsigned long int obstime;
    119   unsigned long int regtime;
     134  e_time obstime;
     135  e_time regtime;
    120136} RegImage;  /* 360 bytes / image */
    121137
     
    127143  float exptime;
    128144  float airmass;
    129   unsigned long int obstime;
     145  e_time obstime;
    130146  short int ccdnum;
    131147  char junk1, junk2;
     
    135151/* Old Detrend Database structure */
    136152typedef struct {
    137   unsigned long int tstart;
    138   unsigned long int tstop;
    139   unsigned long int treg;
     153  e_time tstart;
     154  e_time tstop;
     155  e_time treg;
    140156  float sigma, clipsigma;
    141157  int type;
     
    148164/* Detrend Database structure */
    149165typedef struct {
    150   unsigned long int tstart;
    151   unsigned long int tstop;
    152   unsigned long int treg;
     166  e_time tstart;
     167  e_time tstop;
     168  e_time treg;
    153169  float exptime;
    154170  int type;
     
    171187  float K;                    /* airmass term used */
    172188  float X;                    /* color term used */
    173   unsigned long int tstart;   /* start time of observation */
    174   unsigned long int tstop;    /* end time of observation */
     189  e_time tstart;   /* start time of observation */
     190  e_time tstop;    /* end time of observation */
    175191  short int c1;               /* photcode for color term */
    176192  short int c2;               /* photcode for color term */
     
    186202  float K;                    /* airmass term used */
    187203  float X;                    /* color term used */
    188   unsigned long int tstart;   /* start time of observation */
    189   unsigned long int tstop;    /* end time of observation */
     204  e_time tstart;   /* start time of observation */
     205  e_time tstop;    /* end time of observation */
    190206  short int c1;               /* photcode for color term */
    191207  short int c2;               /* photcode for color term */
     
    443459void coords_precess (double *ra, double *dec, double in_epoch, double out_epoch);
    444460
     461int get_image_type (char *name);
     462char *get_type_name (int type);
     463int get_image_mode (char *name);
     464char *get_mode_name (int mode);
     465
    445466# endif
Note: See TracChangeset for help on using the changeset viewer.