IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 7, 2005, 6:55:53 AM (21 years ago)
Author:
eugene
Message:

further cleanup to use autocode

File:
1 edited

Legend:

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

    r4026 r4500  
    44# define DVO_H
    55
    6 /*** FITS DB structure  ***/
    7 typedef struct {
    8   FILE  *f;
    9   char  *filename;
    10   int    dbstate;
    11   int    lockstate;
    12   double timeout;
    13   Header header;
    14   Matrix matrix;
    15   Header theader;
    16   FTable ftable;
    17 } FITS_DB;
    18 
    19 # if (0)
    20 /* the standard astrometric coordinates structure */
    21 typedef struct {
    22   double   crval1, crval2;
    23   float    crpix1, crpix2;
    24   float    cdelt1, cdelt2;
    25   float    pc1_1, pc1_2;
    26   float    pc2_1, pc2_2;
    27   float    polyterms[7][2];
    28   char     ctype[15];
    29   char     Npolyterms;
    30 } Coords;  /* 120 bytes / Coords */
    31 # endif
    32 
    33 /* in fits_db.c */
    34 int   fits_db_init                PROTO((FITS_DB *db));
    35 int   fits_db_create              PROTO((FITS_DB *db));
    36 int   fits_db_lock                PROTO((FITS_DB *db, char *filename));
    37 int   fits_db_load                PROTO((FITS_DB *db));
    38 int   fits_db_close               PROTO((FITS_DB *db));
    39 int   fits_db_free                PROTO((FITS_DB *db));
    40 int   fits_db_save                PROTO((FITS_DB *db));
    41 int   fits_db_update              PROTO((FITS_DB *db, VTable *vtable));
    42 
    43 /* in coords.c, using libautocode/def/coords.d */
    44 int  XY_to_RD (double *ra, double *dec, double x,  double y,   Coords *coords);
    45 int  RD_to_XY (double *x,  double *y,   double ra, double dec, Coords *coords);
    46 int  fXY_to_RD (float *ra, float *dec, double x,  double y,   Coords *coords);
    47 int  fRD_to_XY (float *x,  float *y,   double ra, double dec, Coords *coords);
    48 int  GetCoords (Coords *coords, Header *header);
    49 int  PutCoords (Coords *coords, Header *header);
    50 void RegisterMosaic (Coords *coords);
    51 void coords_precess (double *ra, double *dec, double in_epoch, double out_epoch);
     6/*** named data values (convert all to enums?) ***/
    527
    538/* image data modes in RegImage */
     
    5510enum {M_UNDEF = -1, M_NONE, M_MEF, M_SPLIT, M_SINGLE, M_CUBE, M_SLICE, M_MODES, N_MODE};
    5611
    57 /* convert these to enums? */
    5812/* RegImage.flag values */
    5913# define IMREG_DIST  0x01 /* image distributed, only imregister-3.0 */
     
    9347# define ID_MEAS_TRAIL        0x2000
    9448# define ID_MEAS_GHOST        0x4000
     49
     50/* some subtle distinctions between the blend flags:
     51   BLEND_IMAGE: the star on an image is matched with more
     52      than one star in the catalog (image has worse seeing than catalog)
     53   BLEND_CATALOG: the star in the catalog is matched with more
     54      than one star on the image (image has better seeing than catalog)
     55   CALIBRATED: relative photometry has been performed on this measurement
     56   BLEND_IMAGE_NEIGHBOR: the star on an image is matched with more
     57      than one star in the catalog, but not in the same catalog file.
     58*/
    9559
    9660/* Average.code values */
     
    10973# define ID_COSMIC     0xc004 /* 0x8000 + 0x4000 + 0x0004 */
    11074
    111 /*
    112    BLEND_IMAGE: the star on an image is matched with more
    113       than one star in the catalog (image has worse seeing than catalog)
    114    BLEND_CATALOG: the star in the catalog is matched with more
    115       than one star on the image (image has better seeing than catalog)
    116    CALIBRATED: relative photometry has been performed on this measurement
    117    BLEND_IMAGE_NEIGHBOR: the star on an image is matched with more
    118       than one star in the catalog, but not in the same catalog file.
    119 */
    120 
    121 /** we are going to replace these with autocode and appropriate conversions
    122     for now, choose the appropriate table version **/
    123 
    124 # define ELIXIR    1
    125 # define LONEOS    0
    126 # define PANSTARRS 0
    127 
    128 # if (LONEOS)
    129 # include <loneos.h>
    130 # endif
    131 
    132 # if (ELIXIR)
    133 # include <elixir.h>
    134 # endif
    135 
    136 # if (PANSTARRS)
    137 # include <panstarrs.h>
    138 # endif
    139 
    140 /* these functions refer to the DVO structures defined in the includes above
    141  *  they are being replaced with autocode entries
     75/*** general dvo structures (internal use only / not IO) ***/
     76
     77/* FITS DB structure */
     78typedef struct {
     79  FILE  *f;
     80  char  *filename;
     81  int    dbstate;
     82  int    lockstate;
     83  double timeout;
     84  Header header;
     85  Matrix matrix;
     86  Header theader;
     87  FTable ftable;
     88} FITS_DB;
     89
     90/* structure for data on a catalog region */
     91typedef struct {
     92  char filename[256];
     93  double DEC[2], RA[2];
     94} GSCRegion;
     95
     96typedef struct {
     97  int Ncode;
     98  int Nsecfilt;
     99  int hashcode[0x10000];
     100  int hashNsec[0x10000];
     101  PhotCode *code;
     102} PhotCodeData;
     103
     104/* a catalog contains this data */
     105typedef struct {
     106  /* data in the file: */
     107  Average *average;
     108  Measure *measure;
     109  Missing *missing;
     110  SecFilt *secfilt;
     111  Header  header;
     112  int Naverage, Nmeasure, Nmissing, Nsecfilt;
     113  /* description of the catalog file: */
     114  char *filename;
     115  int lockmode;
     116  FILE *f;
     117  /* pointers for data manipulation */
     118  int *found;
     119  int *image;
     120  int *mosaic;
     121  float *X;
     122  float *Y;
     123} Catalog;
     124
     125/*** prototypes ***/
     126
     127/* in fits_db.c */
     128int   fits_db_init                PROTO((FITS_DB *db));
     129int   fits_db_create              PROTO((FITS_DB *db));
     130int   fits_db_lock                PROTO((FITS_DB *db, char *filename));
     131int   fits_db_load                PROTO((FITS_DB *db));
     132int   fits_db_close               PROTO((FITS_DB *db));
     133int   fits_db_free                PROTO((FITS_DB *db));
     134int   fits_db_save                PROTO((FITS_DB *db));
     135int   fits_db_update              PROTO((FITS_DB *db, VTable *vtable));
     136
     137/* in coords.c, using libautocode/def/coords.d */
     138int  XY_to_RD (double *ra, double *dec, double x,  double y,   Coords *coords);
     139int  RD_to_XY (double *x,  double *y,   double ra, double dec, Coords *coords);
     140int  fXY_to_RD (float *ra, float *dec, double x,  double y,   Coords *coords);
     141int  fRD_to_XY (float *x,  float *y,   double ra, double dec, Coords *coords);
     142int  GetCoords (Coords *coords, Header *header);
     143int  PutCoords (Coords *coords, Header *header);
     144void RegisterMosaic (Coords *coords);
     145void coords_precess (double *ra, double *dec, double in_epoch, double out_epoch);
     146
     147int lock_catalog (Catalog *catalog, int lockmode);
     148int unlock_catalog (Catalog *catalog);
     149int load_catalog (Catalog *catalog, char mode, int VERBOSE);
     150int save_catalog (Catalog *catalog, char VERBOSE);
     151
     152int FindMosaicForImage (Image *images, int Nimages, int entry);
     153int FindMosaicForImage_TableSearch (Image *images, int Nimages, int entry);
     154int FindMosaicForImage_MatchSearch (Image *images, int Nimages, int entry);
     155int BuildChipMatch (Image *images, int Nimages);
     156
     157short int putMi (double value);
     158double getMi (short int value);
     159void returnMcal (Image *image, double *c);
     160void assignMcal (Image *image, double *c, int order);
     161double applyMcal (Image *image, double x, double y);
     162double findscatter (double *X, double *Y, double *M, double *dM, int N, double *c, int order);
     163
     164PhotCode *GetPhotcodebyName (char *name);
     165PhotCode *GetPhotcodeEquivbyName (char *name);
     166PhotCode *GetPhotcodebyCode (int code);
     167PhotCode *GetPhotcodeEquivbyCode (int code);
     168char *GetPhotcodeNamebyCode (int code);
     169
     170double PhotInst (Measure *measure);
     171double PhotAbs (Measure *measure);
     172double PhotCat (Measure *measure);
     173double PhotSys (Measure *measure, Average *average, SecFilt *secfilt);
     174double PhotRel (Measure *measure, Average *average, SecFilt *secfilt);
     175double PhotCal (Measure *thisone, Average *average, SecFilt *secfilt, Measure *measure, PhotCode *code);
     176double PhotAve (PhotCode *code, Average *average, SecFilt *secfilt);
     177double PhotRef (PhotCode *code, Average *average, SecFilt *secfilt, Measure *measure);
     178double PhotXm (PhotCode *code, Average *average, SecFilt *secfilt);
     179double PhotdM (PhotCode *code, Average *average, SecFilt *secfilt);
     180
     181short iPhotInst (Measure *measure);
     182short iPhotAbs (Measure *measure);
     183short iPhotCat (Measure *measure);
     184short iPhotSys (Measure *measure, Average *average, SecFilt *secfilt);
     185short iPhotRel (Measure *measure, Average *average, SecFilt *secfilt);
     186short iPhotCal (Measure *thisone, Average *average, SecFilt *secfilt, Measure *measure, PhotCode *code);
     187short iPhotAve (PhotCode *code, Average *average, SecFilt *secfilt);
     188short iPhotRef (PhotCode *code, Average *average, SecFilt *secfilt, Measure *measure);
     189short iPhotXm (PhotCode *code, Average *average, SecFilt *secfilt);
     190short iPhotdM (PhotCode *code, Average *average, SecFilt *secfilt);
     191
     192short iPhotColor (Average *average, SecFilt *secfilt, Measure *measure, PhotCode *code);
     193int PhotColor (Average *average, SecFilt *secfilt, Measure *measure, int c1, int c2, double *color);
     194
     195int LoadPhotcodes (char *filename);
     196int GetPhotcodeCodebyName (char *name);
     197int GetPhotcodeEquivCodebyName (char *name);
     198int GetPhotcodeEquivCodebyCode (int code);
     199int GetPhotcodeNsec (int code);
     200int GetPhotcodeNsecfilt ();
     201void SetZeroPoint (double ZP);
     202int *GetPhotcodeEquivList (int code, int *nlist);
     203void ParseColorTerms (char *terms, float *X, int *N);
     204
     205int get_image_type (char *name);
     206char *get_type_name (int type);
     207int get_image_mode (char *name);
     208char *get_mode_name (int mode);
     209
     210/* these functions refer to the DVO structures defined in the includes above
     211 *  they are being replaced with autocode entries (drop when totally autocoded)
    142212 */
    143213
Note: See TracChangeset for help on using the changeset viewer.