IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 24, 2005, 4:50:29 PM (21 years ago)
Author:
eugene
Message:

includes cleanup, adding autocode stuff, fits_db

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libohana/include/dvo.h

    r3473 r3508  
    33# define LONEOS    0
    44# define PANSTARRS 0
     5
     6/*** this file uses data types which must have fixed sizes regardless
     7     of the platform.  It originally used the basic C primitives:
     8       float, double, int, short int, unsigned long int, etc.
     9     this breaks under 64 bit (and probably on other systems).
     10     I should define internal data types which should be set by the
     11     use of # define statements if needed.  I will cheat for now and use
     12     the time_t to replace unsigned long int in this file
     13***/
     14
     15# define e_time unsigned int
     16
     17/* image data modes in RegImage */
     18enum {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};
     19enum {M_UNDEF = -1, M_NONE, M_MEF, M_SPLIT, M_SINGLE, M_CUBE, M_SLICE, M_MODES, N_MODE};
     20
     21/* convert these to enums? */
     22/* RegImage.flag values */
     23# define IMREG_DIST  0x01 /* image distributed, only imregister-3.0 */
     24
     25/* catalog values to be loaded */
     26# define LOAD_AVES 0x01
     27# define LOAD_MEAS 0x02
     28# define LOAD_MISS 0x04
     29# define LOAD_SECF 0x08
     30
     31/* invalid mag value */
     32# define NO_MAG    0x7fff
     33# define NO_ERR    0xff
     34
     35/* photometry code types */
     36# define PHOT_PRI 0x01
     37# define PHOT_SEC 0x02
     38# define PHOT_DEP 0x03
     39# define PHOT_REF 0x04
     40# define PHOT_ALT 0x05  /* never stored, only for look-ups */
     41
     42/* Image.code values.  these are codes to note bad images */
     43# define ID_IMAGE_NEW   0x0000  /* no nrphot attempted */
     44# define ID_IMAGE_NOCAL 0x0001  /* used within nrphot to mean "don't apply fit" */
     45# define ID_IMAGE_POOR  0x0002  /* relphot says image is bad */
     46# define ID_IMAGE_SKIP  0x0004  /* external information image is bad */
     47# define ID_IMAGE_FEW   0x0008  /* currently too few measurements for good value */
     48
     49/* Measure.flags values */
     50# define ID_MEAS_NOCAL        0x0001
     51# define ID_MEAS_POOR         0x0002
     52# define ID_MEAS_SKIP         0x0004
     53# define ID_MEAS_AREA         0x0008
     54# define BLEND_IMAGE          0x0100
     55# define BLEND_CATALOG        0x0200
     56# define BLEND_IMAGE_NEIGHBOR 0x1000
     57# define ID_MEAS_TRAIL        0x2000
     58# define ID_MEAS_GHOST        0x4000
     59
     60/* Average.code values */
     61# define ID_STAR_FEW   0x0001 /* used within relphot: skip star */
     62# define ID_STAR_POOR  0x0002 /* used within relphot: skip star */
     63# define ID_PROPER     0x0400 /* star with large proper motion */
     64# define ID_TRANSIENT  0x1000 /* is this mutually exclusive with USNO?  */
     65# define ID_VARIABLE   0x2000 /* not currently set? */
     66# define ID_ASTEROID   0x2000 /* identified with an asteroid */
     67# define ID_BAD_OBJECT 0x4000 /* if all measurements are bad, set this bit */
     68# define ID_MOVING     0x8000
     69# define ID_ROCK       0xa000 /* 0x8000 + 0x2000 */
     70# define ID_GHOST      0xc001 /* 0x8000 + 0x4000 + 0x0001 */
     71# define ID_TRAIL      0xc002 /* 0x8000 + 0x4000 + 0x0002 */
     72# define ID_BLEED      0xc003 /* 0x8000 + 0x4000 + 0x0003 */
     73# define ID_COSMIC     0xc004 /* 0x8000 + 0x4000 + 0x0004 */
     74
     75/*
     76   BLEND_IMAGE: the star on an image is matched with more
     77      than one star in the catalog (image has worse seeing than catalog)
     78   BLEND_CATALOG: the star in the catalog is matched with more
     79      than one star on the image (image has better seeing than catalog)
     80   CALIBRATED: relative photometry has been performed on this measurement
     81   BLEND_IMAGE_NEIGHBOR: the star on an image is matched with more
     82      than one star in the catalog, but not in the same catalog file.
     83*/
     84
     85/*** FITS DB structure  ***/
     86typedef struct {
     87  FILE  *f;
     88  char  *filename;
     89  int    dbstate;
     90  int    lockstate;
     91  double timeout;
     92  Header header;
     93  Matrix matrix;
     94  Header theader;
     95  FTable ftable;
     96} FITS_DB;
     97
     98/* the standard astrometric coordinates structure */
     99typedef struct {
     100  double   crval1, crval2;
     101  float    crpix1, crpix2;
     102  float    cdelt1, cdelt2;
     103  float    pc1_1, pc1_2;
     104  float    pc2_1, pc2_2;
     105  float    polyterms[7][2];
     106  char     ctype[15];
     107  char     Npolyterms;
     108} Coords;  /* 120 bytes / Coords */
     109
     110/*** FITS_DB functions ***/
     111
     112/* in fits_db.c */
     113int   fits_db_init                PROTO((FITS_DB *db));
     114int   fits_db_lock                PROTO((FITS_DB *db, char *filename));
     115int   fits_db_load                PROTO((FITS_DB *db));
     116int   fits_db_close               PROTO((FITS_DB *db));
     117int   fits_db_free                PROTO((FITS_DB *db));
     118int   fits_db_save                PROTO((FITS_DB *db));
     119int   fits_db_update              PROTO((FITS_DB *db, VTable *vtable));
     120
     121/* in coords.c */
     122int  XY_to_RD (double *ra, double *dec, double x,  double y,   Coords *coords);
     123int  RD_to_XY (double *x,  double *y,   double ra, double dec, Coords *coords);
     124int  fXY_to_RD (float *ra, float *dec, double x,  double y,   Coords *coords);
     125int  fRD_to_XY (float *x,  float *y,   double ra, double dec, Coords *coords);
     126int  GetCoords (Coords *coords, Header *header);
     127int  PutCoords (Coords *coords, Header *header);
     128void RegisterMosaic (Coords *coords);
     129void coords_precess (double *ra, double *dec, double in_epoch, double out_epoch);
    5130
    6131# if (LONEOS)
     
    16141# endif
    17142
     143# include <dvo-autocode.h>
     144
     145/* these functions refer to the DVO structures define in the includes above */
     146int   Fread (void *ptr, int size, int nitems, FILE *f, char *type);
     147int   Fwrite (void *ptr, int size, int nitems, FILE *f, char *type);
     148int   ByteSwap (char *ptr, int size, int nitems, char *type);
     149int   ConvertStruct (char *buffer, int size, int Nbytes, char *type);
Note: See TracChangeset for help on using the changeset viewer.