IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 12, 2015, 6:18:23 PM (11 years ago)
Author:
eugene
Message:

merge changes from EAM dev branch ohana.20150429

Location:
trunk/Ohana
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana

  • trunk/Ohana/src/libdvo/include/dvo.h

    r38154 r38441  
    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_NONE_1, DVO_COMPRESS_NONE_2, DVO_COMPRESS_AUTO, DVO_COMPRESS_GZIP_1, DVO_COMPRESS_GZIP_2, DVO_COMPRESS_RICE_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;
     35} DVOCatFormat;
     36
     37typedef enum {DVO_CAT_OPEN_FAIL, DVO_CAT_OPEN_OK, DVO_CAT_OPEN_EMPTY} DVOCatalogOpenModes;
     38
     39/* catalog values to be loaded */
     40typedef enum {
     41  DVO_LOAD_NONE     = 0x0000,
     42  DVO_LOAD_AVERAGE  = 0x0001,
     43  DVO_LOAD_MEASURE  = 0x0002,
     44  DVO_LOAD_MISSING  = 0x0004,
     45  DVO_LOAD_SECFILT  = 0x0008,
     46  DVO_SKIP_AVERAGE  = 0x0010,
     47  DVO_SKIP_MEASURE  = 0x0020,
     48  DVO_SKIP_MISSING  = 0x0040,
     49  DVO_SKIP_SECFILT  = 0x0080,
     50  DVO_LOAD_LENSING  = 0x0100,
     51  DVO_LOAD_LENSOBJ  = 0x0200,
     52  DVO_SKIP_LENSING  = 0x0400,
     53  DVO_SKIP_LENSOBJ  = 0x0800,
     54  DVO_LOAD_STARPAR  = 0x1000,
     55  DVO_SKIP_STARPAR  = 0x2000,
     56  DVO_LOAD_GALPHOT = 0x4000,
     57  DVO_SKIP_GALPHOT = 0x8000,
     58} DVOCatFlags;
    3359
    3460/* image data modes in RegImage */
    3561typedef 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;
    3662typedef enum {M_UNDEF = -1, M_NONE, M_MEF, M_SPLIT, M_SINGLE, M_CUBE, M_SLICE, M_MODES, N_MODE} ElixirDetrendModes;
    37 
    38 typedef enum {DVO_CAT_OPEN_FAIL, DVO_CAT_OPEN_OK, DVO_CAT_OPEN_EMPTY} DVOCatalogOpenModes;
    3963
    4064// these are used as NAN for types of int values
     
    5478# define IMREG_DIST  0x01 /* image distributed, only imregister-3.0 */
    5579
    56 /* catalog values to be loaded */
    57 # define LOAD_NONE      0x0000
    58 # define LOAD_AVES      0x0001
    59 # define LOAD_MEAS      0x0002
    60 # define LOAD_MISS      0x0004
    61 # define LOAD_SECF      0x0008
    62 # define SKIP_AVES      0x0010
    63 # define SKIP_MEAS      0x0020
    64 # define SKIP_MISS      0x0040
    65 # define SKIP_SECF      0x0080
    66 # define LOAD_LENSING   0x0100
    67 # define LOAD_LENSOBJ   0x0200
    68 # define SKIP_LENSING   0x0400
    69 # define SKIP_LENSOBJ   0x0800
    70 # define LOAD_STARPAR   0x1000
    71 # define SKIP_STARPAR   0x2000
    72 
    7380/* photometry code types */
    7481// # define PHOT_PRI 0x01
    75 # define PHOT_SEC 0x02
    76 # define PHOT_DEP 0x03
    77 # define PHOT_REF 0x04
    78 # define PHOT_ALT 0x05  /* never stored, only for look-ups */
    79 # define PHOT_MAG 0x06  /* generic magnitude; never stored */
     82typedef enum {
     83  PHOT_SEC  = 0x02,
     84  PHOT_DEP  = 0x03,
     85  PHOT_REF  = 0x04,
     86  PHOT_ALT  = 0x05,  /* never stored, only for look-ups */
     87  PHOT_MAG  = 0x06,  /* generic magnitude; never stored */
     88} DVOPhotCodeTypes;
    8089
    8190/* Image.code values -- these values are 32 bit (as of PS1_V1) */
     
    222231  char   lockstate;
    223232  char   mode;          /* what data storage mode is used for disk file? */
    224   char   format;        /* what data format is used for disk file? */
     233  DVOCatFormat format;  /* what data format is used for disk file? */
    225234  char   virtual;       /* is table in ftable or vtable? */
    226   char   swapped;       /* is table in internal byte-order? */
     235  char   nativeOrder;   /* is table in internal byte-order? */
     236  char   scaledValue;   /* is table in internal byte-order? */
    227237} FITS_DB;
    228238
     
    484494  unsigned short   Nmeasure;             // number of psf measurements
    485495  unsigned short   Nmissing;             // number of missings
    486   unsigned short   Nextend;              // number of extended measurements
     496  unsigned short   Ngalphot;            // number of extended measurements
    487497  uint32_t         measureOffset;        // offset to first psf measurement
    488498  uint32_t         missingOffset;        // offset to first missing obs
     
    704714  unsigned short   Nlensing;             // number of lensing measurements
    705715  unsigned short   Nlensobj;             // number of lensing measurements
    706   unsigned short   Nextend;              // number of extended measurements
     716  unsigned short   Ngalphot;            // number of galphot measurements
    707717  int              measureOffset;        // offset to first psf measurement
    708718  int              missingOffset;        // offset to first missing obs
    709719  int              lensingOffset;        // offset to first lensing obs
    710720  int              lensobjOffset;        // offset to mean lensing data
    711   int              extendOffset;         // offset to extended object entry
     721  int              galphotOffset;       // offset to extended object entry
    712722  int              starparOffset;        // offset to stellar parameter data
    713723  float            refColorBlue;         // color of astrometry ref stars
     
    742752
    743753  // lensing data (optional?)
    744   Lensing *lensing;
    745   Lensobj *lensobj;
    746   StarPar *starpar;
     754  Lensing  *lensing;
     755  Lensobj  *lensobj;
     756  StarPar  *starpar;
     757  GalPhot *galphot;
    747758
    748759  int Nsecfilt;  /* number of secfilt entries for each average entry */
    749   off_t Naverage,   Nmeasure,   Nmissing,   Nlensing,      Nlensobj,      Nstarpar,      Nsecf_mem;  /* current number of each component in memory */
    750   off_t Naves_disk, Nmeas_disk, Nmiss_disk, Nlensing_disk, Nlensobj_disk, Nstarpar_disk, Nsecf_disk; /* current number of each component on disk */
    751   off_t Naves_off,  Nmeas_off,  Nmiss_off,  Nlensing_off,  Nlensobj_off,  Nstarpar_off,  Nsecf_off;  /* index of first loaded data value */
     760  off_t Naverage,      Nmeasure,      Nmissing,      Nlensing,      Nlensobj,      Nstarpar,      Ngalphot,      Nsecfilt_mem;  /* current number of each component in memory */
     761  off_t Naverage_disk, Nmeasure_disk, Nmissing_disk, Nlensing_disk, Nlensobj_disk, Nstarpar_disk, Ngalphot_disk, Nsecfilt_disk; /* current number of each component on disk */
     762  off_t Naverage_off,  Nmeasure_off,  Nmissing_off,  Nlensing_off,  Nlensobj_off,  Nstarpar_off,  Ngalphot_off,  Nsecfilt_off;  /* index of first loaded data value */
    752763
    753764  // note that we use these for the full-sky relphot analysis
     
    765776
    766777  /* pointers to split data files */
    767   struct Catalog *measure_catalog;              /* measure catalog data (split) */
    768   struct Catalog *missing_catalog;              /* missing catalog data (split) */
    769   struct Catalog *secfilt_catalog;              /* secfilt catalog data (split) */
    770   struct Catalog *lensing_catalog;              /* lensing catalog data (split) */
    771   struct Catalog *lensobj_catalog;              /* lensobj catalog data (split) */
    772   struct Catalog *starpar_catalog;              /* starpar catalog data (split) */
     778  struct Catalog *measure_catalog;              /* measure  catalog data (split) */
     779  struct Catalog *missing_catalog;              /* missing  catalog data (split) */
     780  struct Catalog *secfilt_catalog;              /* secfilt  catalog data (split) */
     781  struct Catalog *lensing_catalog;              /* lensing  catalog data (split) */
     782  struct Catalog *lensobj_catalog;              /* lensobj  catalog data (split) */
     783  struct Catalog *starpar_catalog;              /* starpar  catalog data (split) */
     784  struct Catalog *galphot_catalog;              /* galphot catalog data (split) */
    773785
    774786  unsigned int objID;
     
    777789  /* extra catalog information */
    778790  char lockmode;
    779   char catmode;                         /* storage mode (raw, mef, split, mysql) */
    780   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 
    781796  int sorted;                           /* is measure table average-sorted? (NOTE this is an int only because gfits_scan %t requires it) */
    782  
    783   short catflags; /* choices to be loaded */
     797
    784798
    785799  /* pointers for data manipulation */
     
    928942int dvo_catalog_save_complete (Catalog *catalog, char VERBOSE);
    929943int dvo_catalog_update (Catalog *catalog, char VERBOSE);
    930 int dvo_catalog_catformat (char *catformat);
    931 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);
    932948void dvo_catalog_test (Catalog *catalog, int halt);
    933949
     
    956972int WriteRawSecFilt (FILE *f, SecFilt *secfilt, off_t Nsecfilt, char format);
    957973
    958 DVOTableFormat FtableGetFormat (FTable *ftable);
    959 
    960 Average *FtableToAverage (FTable *ftable, off_t *Naverage, char *format, SecFilt **primary);
    961 Measure *FtableToMeasure (FTable *ftable, Average *average, off_t *Nmeasure, char *format);
    962 SecFilt *FtableToSecFilt (FTable *ftable, off_t *Nsecfilt, char *format);
    963 Lensing *FtableToLensing (FTable *ftable, off_t *Nlensing, char *format);
    964 Lensobj *FtableToLensobj (FTable *ftable, off_t *Nlensobj, char *format);
    965 StarPar *FtableToStarPar (FTable *ftable, off_t *Nstarpar, char *format);
    966 int      FtableToImage   (FTable *ftable, Header *theader, char *format);
    967 
    968 int AverageToFtable (FTable *ftable, Average *average, off_t Naverage, char format, SecFilt *primary);
    969 int MeasureToFtable (FTable *ftable, Average *average, Measure *measure, off_t Nmeasure, char format);
    970 int SecFiltToFtable (FTable *ftable, SecFilt *secfilt, off_t Nsecfilt, char format);
    971 int LensingToFtable (FTable *ftable, Lensing *lensing, off_t Nlensing, char format);
    972 int LensobjToFtable (FTable *ftable, Lensobj *lensobj, off_t Nlensobj, char format);
    973 int StarParToFtable (FTable *ftable, StarPar *starpar, off_t Nstarpar, char format);
    974 int ImageToFtable (FTable *ftable, Header *theader, char format);
    975 int ImageToVtable (VTable *vtable, Header *theader, char format);
     974DVOCatFormat FtableGetFormat (FTable *ftable);
     975
     976Average *FtableToAverage   (FTable *ftable, off_t *Naverage,  DVOCatFormat *format, SecFilt **primary, char nativeOrder);
     977
     978Measure *FtableToMeasure   (FTable *ftable, Average *average, off_t *Nmeasure,  DVOCatFormat *format, char nativeOrder);
     979Missing *FtableToMissing   (FTable *ftable, Average *average, off_t *Nmissing,  DVOCatFormat *format, char nativeBytes);
     980SecFilt *FtableToSecFilt   (FTable *ftable, Average *average, off_t *Nsecfilt,  DVOCatFormat *format, char nativeOrder);
     981Lensing *FtableToLensing   (FTable *ftable, Average *average, off_t *Nlensing,  DVOCatFormat *format, char nativeOrder);
     982Lensobj *FtableToLensobj   (FTable *ftable, Average *average, off_t *Nlensobj,  DVOCatFormat *format, char nativeOrder);
     983StarPar *FtableToStarPar   (FTable *ftable, Average *average, off_t *Nstarpar,  DVOCatFormat *format, char nativeOrder);
     984GalPhot *FtableToGalPhot (FTable *ftable, Average *average, off_t *Ngalphot, DVOCatFormat *format, char nativeOrder);
     985
     986int      FtableToImage   (FTable *ftable, Header *theader, DVOCatFormat *format);
     987
     988int MeasureToFtable  (FTable *ftable, Average  *average,  Measure *measure, off_t Nmeasure, DVOCatFormat format, int swapFromNative);
     989int AverageToFtable  (FTable *ftable, Average  *average,  off_t Naverage,  DVOCatFormat format, SecFilt *primary, int swapFromNative);
     990int SecFiltToFtable  (FTable *ftable, SecFilt  *secfilt,  off_t Nsecfilt,  DVOCatFormat format, int swapFromNative);
     991int LensingToFtable  (FTable *ftable, Lensing  *lensing,  off_t Nlensing,  DVOCatFormat format, int swapFromNative);
     992int LensobjToFtable  (FTable *ftable, Lensobj  *lensobj,  off_t Nlensobj,  DVOCatFormat format, int swapFromNative);
     993int StarParToFtable  (FTable *ftable, StarPar  *starpar,  off_t Nstarpar,  DVOCatFormat format, int swapFromNative);
     994int GalPhotToFtable (FTable *ftable, GalPhot *galphot, off_t Ngalphot, DVOCatFormat format, int swapFromNative);
     995
     996int ImageToFtable (FTable *ftable, Header *theader, DVOCatFormat format);
     997int ImageToVtable (VTable *vtable, Header *theader, DVOCatFormat format);
    976998
    977999# include "loneos_defs.h"
     
    10051027int gfits_table_set_Image (FTable *ftable);
    10061028int gfits_table_mkheader_Image (Header *header);
    1007 Image *gfits_table_get_Image (FTable *ftable, off_t *Ndata, char *swapped);
     1029Image *gfits_table_get_Image (FTable *ftable, off_t *Ndata, char *scaledValue, char *nativeOrder);
    10081030
    10091031/* flatcorr APIs */
     
    10691091void InitHost (HostInfo *host);
    10701092
    1071 HostTableGroup *HostTableGroups (HostTable *table, int *ngroups);
     1093HostTableGroup *HostTableGroupsUniqueMachines (HostTable *table, int *ngroups);
     1094HostTableGroup *HostTableGroupsMaxNumber (HostTable *table, int *ngroups, int Nmax);
     1095
    10721096int HostTableGroupWaitJobsGetIO (HostTableGroup *table, char *file, int lineno, int VERBOSE);
    10731097
     
    11061130void dvo_lensobj_init (Lensobj *lensobj, int toZero);
    11071131void dvo_starpar_init (StarPar *starpar);
     1132void dvo_galphot_init (GalPhot *galphot);
    11081133
    11091134void InitRegionHosts (RegionHostInfo *hosts, int Nhosts, int NHOSTS);
Note: See TracChangeset for help on using the changeset viewer.