IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 1, 2015, 8:10:18 PM (11 years ago)
Author:
eugene
Message:

add compression option to catalog; explicit enum types for catmode, catformat, catcompress; gfits_db_init inits all of the structure (but now must be called before signalling values are set)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20150429/src/libdvo/include/dvo.h

    r38345 r38346  
    1010
    1111/* DVO table modes */
    12 typedef enum {DVO_MODE_UNDEF, DVO_MODE_RAW, DVO_MODE_MEF, DVO_MODE_SPLIT, DVO_MODE_MYSQL} DVOTableMode;
     12typedef enum {DVO_MODE_UNDEF = 0, DVO_MODE_RAW, DVO_MODE_MEF, DVO_MODE_SPLIT, DVO_MODE_MYSQL} DVOCatMode;
     13
     14/* DVO table modes */
     15typedef enum {DVO_COMPRESS_NONE = 0, DVO_COMPRESS_GZIP_1} DVOCatCompress; //
    1316
    1417/* DVO table formats */
    1518typedef enum {
    16   DVO_FORMAT_UNDEF,
     19  DVO_FORMAT_UNDEF = 0,
    1720  DVO_FORMAT_INTERNAL,
    1821  DVO_FORMAT_ELIXIR,
     
    3033  DVO_FORMAT_PS1_V4,
    3134  DVO_FORMAT_PS1_V5,
    32 } DVOTableFormat;
    33 
    34 /* image data modes in RegImage */
    35 typedef enum {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} ElixirDetrendTypes;
    36 typedef enum {M_UNDEF = -1, M_NONE, M_MEF, M_SPLIT, M_SINGLE, M_CUBE, M_SLICE, M_MODES, N_MODE} ElixirDetrendModes;
     35} DVOCatFormat;
    3736
    3837typedef enum {DVO_CAT_OPEN_FAIL, DVO_CAT_OPEN_OK, DVO_CAT_OPEN_EMPTY} DVOCatalogOpenModes;
    39 
    40 // these are used as NAN for types of int values
    41 typedef enum {
    42   NAN_S_CHAR  = 0x7f,
    43   NAN_U_CHAR  = 0xff,   // was NO_ERR
    44   NAN_S_SHORT = 0x7fff, // was NO_MAG
    45   NAN_U_SHORT = 0xffff,
    46   NAN_S_INT   = 0x7fffffff,
    47   NAN_U_INT   = (signed int) 0xffffffff,
    48 } DVO_INT_NAN;
    49 
    50 // max path length
    51 # define DVO_MAX_PATH 1024
    52 
    53 /* RegImage.flag values */
    54 # define IMREG_DIST  0x01 /* image distributed, only imregister-3.0 */
    5538
    5639/* catalog values to be loaded */
     
    7457  SKIP_GALSHAPE = 0x8000,
    7558} DVOCatFlags;
     59
     60/* image data modes in RegImage */
     61typedef enum {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} ElixirDetrendTypes;
     62typedef enum {M_UNDEF = -1, M_NONE, M_MEF, M_SPLIT, M_SINGLE, M_CUBE, M_SLICE, M_MODES, N_MODE} ElixirDetrendModes;
     63
     64// these are used as NAN for types of int values
     65typedef enum {
     66  NAN_S_CHAR  = 0x7f,
     67  NAN_U_CHAR  = 0xff,   // was NO_ERR
     68  NAN_S_SHORT = 0x7fff, // was NO_MAG
     69  NAN_U_SHORT = 0xffff,
     70  NAN_S_INT   = 0x7fffffff,
     71  NAN_U_INT   = (signed int) 0xffffffff,
     72} DVO_INT_NAN;
     73
     74// max path length
     75# define DVO_MAX_PATH 1024
     76
     77/* RegImage.flag values */
     78# define IMREG_DIST  0x01 /* image distributed, only imregister-3.0 */
    7679
    7780/* photometry code types */
     
    228231  char   lockstate;
    229232  char   mode;          /* what data storage mode is used for disk file? */
    230   char   format;        /* what data format is used for disk file? */
     233  DVOCatFormat format;  /* what data format is used for disk file? */
    231234  char   virtual;       /* is table in ftable or vtable? */
    232235  char   nativeOrder;   /* is table in internal byte-order? */
     
    786789  /* extra catalog information */
    787790  char lockmode;
    788   char catmode;                         /* storage mode (raw, mef, split, mysql) */
    789   char catformat;                       /* storage format (elixir, panstarrs, etc) */
     791  DVOCatMode     catmode;     /* storage mode (raw, mef, split, mysql) */
     792  DVOCatFormat   catformat;                     /* storage format (elixir, panstarrs, etc) */
     793  DVOCatCompress catcompress;                   // output compress mode
     794  DVOCatFlags    catflags;                      /* choices to be loaded */
     795 
    790796  int sorted;                           /* is measure table average-sorted? (NOTE this is an int only because gfits_scan %t requires it) */
    791   char compressOutput;
    792  
    793   DVOCatFlags catflags; /* choices to be loaded */
     797
    794798
    795799  /* pointers for data manipulation */
     
    938942int dvo_catalog_save_complete (Catalog *catalog, char VERBOSE);
    939943int dvo_catalog_update (Catalog *catalog, char VERBOSE);
    940 int dvo_catalog_catformat (char *catformat);
    941 int dvo_catalog_catmode (char *catmode);
     944DVOCatFormat dvo_catalog_catformat (char *catformat);
     945DVOCatMode dvo_catalog_catmode (char *catmode);
     946DVOCatCompress dvo_catalog_catcompress (char *catcompress);
     947char *dvo_catalog_compress_string (DVOCatCompress catcompress);
    942948void dvo_catalog_test (Catalog *catalog, int halt);
    943949
     
    966972int WriteRawSecFilt (FILE *f, SecFilt *secfilt, off_t Nsecfilt, char format);
    967973
    968 DVOTableFormat FtableGetFormat (FTable *ftable);
    969 
    970 Average *FtableToAverage (FTable *ftable, off_t *Naverage, char *format, SecFilt **primary, char nativeBytes);
    971 Measure *FtableToMeasure (FTable *ftable, Average *average, off_t *Nmeasure, char *format);
    972 SecFilt *FtableToSecFilt (FTable *ftable, off_t *Nsecfilt, char *format);
    973 Lensing *FtableToLensing (FTable *ftable, off_t *Nlensing, char *format);
    974 Lensobj *FtableToLensobj (FTable *ftable, off_t *Nlensobj, char *format);
    975 StarPar *FtableToStarPar (FTable *ftable, off_t *Nstarpar, char *format);
    976 GalShape *FtableToGalShape (FTable *ftable, off_t *Ngalshape, char *format);
    977 
    978 int      FtableToImage   (FTable *ftable, Header *theader, char *format);
    979 
    980 int AverageToFtable (FTable *ftable, Average *average, off_t Naverage, char format, SecFilt *primary, int swapFromNative);
    981 int MeasureToFtable (FTable *ftable, Average *average, Measure *measure, off_t Nmeasure, char format);
    982 int SecFiltToFtable (FTable *ftable, SecFilt *secfilt, off_t Nsecfilt, char format);
    983 int LensingToFtable (FTable *ftable, Lensing *lensing, off_t Nlensing, char format);
    984 int LensobjToFtable (FTable *ftable, Lensobj *lensobj, off_t Nlensobj, char format);
    985 int StarParToFtable (FTable *ftable, StarPar *starpar, off_t Nstarpar, char format);
    986 int GalShapeToFtable (FTable *ftable, GalShape *galshape, off_t Ngalshape, char format);
    987 
    988 int ImageToFtable (FTable *ftable, Header *theader, char format);
    989 int ImageToVtable (VTable *vtable, Header *theader, char format);
     974DVOCatFormat FtableGetFormat (FTable *ftable);
     975
     976Measure *FtableToMeasure   (FTable *ftable, Average *average, off_t *Nmeasure, DVOCatFormat *format);
     977Average *FtableToAverage   (FTable *ftable, off_t *Naverage,  DVOCatFormat *format, SecFilt **primary, char nativeBytes);
     978SecFilt *FtableToSecFilt   (FTable *ftable, off_t *Nsecfilt,  DVOCatFormat *format);
     979Lensing *FtableToLensing   (FTable *ftable, off_t *Nlensing,  DVOCatFormat *format);
     980Lensobj *FtableToLensobj   (FTable *ftable, off_t *Nlensobj,  DVOCatFormat *format);
     981StarPar *FtableToStarPar   (FTable *ftable, off_t *Nstarpar,  DVOCatFormat *format);
     982GalShape *FtableToGalShape (FTable *ftable, off_t *Ngalshape, DVOCatFormat *format);
     983
     984int      FtableToImage   (FTable *ftable, Header *theader, DVOCatFormat *format);
     985
     986int MeasureToFtable  (FTable *ftable, Average  *average,  Measure *measure, off_t Nmeasure, DVOCatFormat format);
     987int AverageToFtable  (FTable *ftable, Average  *average,  off_t Naverage,  DVOCatFormat format, SecFilt *primary, int swapFromNative);
     988int SecFiltToFtable  (FTable *ftable, SecFilt  *secfilt,  off_t Nsecfilt,  DVOCatFormat format);
     989int LensingToFtable  (FTable *ftable, Lensing  *lensing,  off_t Nlensing,  DVOCatFormat format);
     990int LensobjToFtable  (FTable *ftable, Lensobj  *lensobj,  off_t Nlensobj,  DVOCatFormat format);
     991int StarParToFtable  (FTable *ftable, StarPar  *starpar,  off_t Nstarpar,  DVOCatFormat format);
     992int GalShapeToFtable (FTable *ftable, GalShape *galshape, off_t Ngalshape, DVOCatFormat format);
     993
     994int ImageToFtable (FTable *ftable, Header *theader, DVOCatFormat format);
     995int ImageToVtable (VTable *vtable, Header *theader, DVOCatFormat format);
    990996
    991997# include "loneos_defs.h"
Note: See TracChangeset for help on using the changeset viewer.