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

Revision 40063, 63.3 KB (checked in by eugene, 3 months ago)

add PS1_V5_LOAD format for faster addstar loading

Line 
1# ifndef DVO_H
2# define DVO_H
3
4# include <ohana.h>
5# include <gfitsio.h>
6# include <autocode.h>
7
8# include <libdvo_astro.h>
9# include <dvodb.h>
10
11/* DVO table modes */
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_AUTO_1, DVO_COMPRESS_AUTO_2, DVO_COMPRESS_GZIP_1, DVO_COMPRESS_GZIP_2, DVO_COMPRESS_RICE_1} DVOCatCompress; //
16
17/* DVO table formats */
18typedef enum {
19  DVO_FORMAT_UNDEF = 0, 
20  DVO_FORMAT_INTERNAL, 
21  DVO_FORMAT_ELIXIR, 
22  DVO_FORMAT_LONEOS, 
23  DVO_FORMAT_PANSTARRS_DEV_0,
24  DVO_FORMAT_PANSTARRS_DEV_1,
25  DVO_FORMAT_PS1_DEV_1,
26  DVO_FORMAT_PS1_DEV_2,
27  DVO_FORMAT_PS1_DEV_3,
28  DVO_FORMAT_PS1_REF,
29  DVO_FORMAT_PS1_SIM,
30  DVO_FORMAT_PS1_V1,
31  DVO_FORMAT_PS1_V2,
32  DVO_FORMAT_PS1_V3,
33  DVO_FORMAT_PS1_V4,
34  DVO_FORMAT_PS1_V5,
35  DVO_FORMAT_PS1_V5_LOAD,
36} DVOCatFormat;
37
38typedef enum {DVO_CAT_OPEN_FAIL, DVO_CAT_OPEN_OK, DVO_CAT_OPEN_EMPTY} DVOCatalogOpenModes;
39
40/* catalog values to be loaded */
41typedef enum {
42  DVO_LOAD_NONE     = 0x0000,
43  DVO_LOAD_AVERAGE  = 0x0001,
44  DVO_LOAD_MEASURE  = 0x0002,
45  DVO_LOAD_MISSING  = 0x0004,
46  DVO_LOAD_SECFILT  = 0x0008, 
47  DVO_SKIP_AVERAGE  = 0x0010,
48  DVO_SKIP_MEASURE  = 0x0020,
49  DVO_SKIP_MISSING  = 0x0040,
50  DVO_SKIP_SECFILT  = 0x0080,
51  DVO_LOAD_LENSING  = 0x0100,
52  DVO_LOAD_LENSOBJ  = 0x0200,
53  DVO_SKIP_LENSING  = 0x0400,
54  DVO_SKIP_LENSOBJ  = 0x0800,
55  DVO_LOAD_STARPAR  = 0x1000,
56  DVO_SKIP_STARPAR  = 0x2000,
57  DVO_LOAD_GALPHOT = 0x4000,
58  DVO_SKIP_GALPHOT = 0x8000,
59} DVOCatFlags;
60
61/* image data modes in RegImage */
62typedef 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;
63typedef enum {M_UNDEF = -1, M_NONE, M_MEF, M_SPLIT, M_SINGLE, M_CUBE, M_SLICE, M_MODES, N_MODE} ElixirDetrendModes;
64
65// these are used as NAN for types of int values
66typedef enum {
67  NAN_S_CHAR  = 0x7f,
68  NAN_U_CHAR  = 0xff,   // was NO_ERR
69  NAN_S_SHORT = 0x7fff, // was NO_MAG
70  NAN_U_SHORT = 0xffff, 
71  NAN_S_INT   = 0x7fffffff,
72  NAN_U_INT   = (signed int) 0xffffffff,
73} DVO_INT_NAN;
74
75// init all data, or just catalog data
76typedef enum {
77  SECFILT_RESET_CHIP  = 0x01,
78  SECFILT_RESET_WARP  = 0x02,
79  SECFILT_RESET_STACK = 0x04,
80  SECFILT_RESET_ALL   = 0x07,
81} SecFiltInitMode;
82 
83// max path length
84# define DVO_MAX_PATH 1024
85
86/* RegImage.flag values */
87# define IMREG_DIST  0x01 /* image distributed, only imregister-3.0 */
88
89/* photometry code types */
90// # define PHOT_PRI 0x01
91typedef enum {
92  PHOT_SEC  = 0x02,
93  PHOT_DEP  = 0x03,
94  PHOT_REF  = 0x04,
95  PHOT_ALT  = 0x05,  /* never stored, only for look-ups */
96  PHOT_MAG  = 0x06,  /* generic magnitude; never stored */
97} DVOPhotCodeTypes;
98
99/* Image.code values -- these values are 32 bit (as of PS1_V1) */
100typedef enum {
101  ID_IMAGE_NEW            = 0x00000000,  /* no calibrations yet attempted */
102  ID_IMAGE_PHOTOM_NOCAL   = 0x00000001,  /* user-set value used within relphot: ignore */
103  ID_IMAGE_PHOTOM_POOR    = 0x00000002,  /* relphot says image is bad (dMcal > limit) */
104  ID_IMAGE_PHOTOM_SKIP    = 0x00000004,  /* user-set value: assert that this image has bad photometry */
105  ID_IMAGE_PHOTOM_FEW     = 0x00000008,  /* currently too few measurements for photometry */
106  ID_IMAGE_ASTROM_NOCAL   = 0x00000010,  /* user-set value used within relastro: ignore */
107  ID_IMAGE_ASTROM_POOR    = 0x00000020,  /* relastro says image is bad (dR,dD > limit) */
108  ID_IMAGE_ASTROM_FAIL    = 0x00000040,  /* relastro fit diverged, fit not applied */
109  ID_IMAGE_ASTROM_SKIP    = 0x00000080,  /* user-set value: assert that this image has bad astrometry */
110  ID_IMAGE_ASTROM_FEW     = 0x00000100,  /* currently too few measurements for astrometry */
111  ID_IMAGE_PHOTOM_UBERCAL = 0x00000200,  /* externally-supplied photometry zero point from ubercal analysis */
112  ID_IMAGE_ASTROM_GMM     = 0x00000400,  /* image was fitted to positions corrected by the galaxy motion model */
113} DVOImageFlags;
114
115/* Measure.flags values -- these values are 32 bit (as of PS1_V1) */
116typedef enum {
117  ID_MEAS_NOCAL            = 0x00000001,  // detection ignored for this analysis (photcode, time range) -- internal only
118  ID_MEAS_POOR_PHOTOM      = 0x00000002,  // detection is photometry outlier                                             
119  ID_MEAS_SKIP_PHOTOM      = 0x00000004,  // detection was ignored for photometry measurement                             
120  ID_MEAS_AREA             = 0x00000008,  // detection near image edge                                               
121  ID_MEAS_POOR_ASTROM      = 0x00000010,  // detection is astrometry outlier                                             
122  ID_MEAS_SKIP_ASTROM      = 0x00000020,  // detection was ignored for astrometry measurement                             
123  ID_MEAS_USED_OBJ         = 0x00000040,  // detection was used during update objects 
124  ID_MEAS_USED_CHIP        = 0x00000080,  // detection was used during update chips (XXX this probably does not make it into the db)
125  ID_MEAS_BLEND_MEAS       = 0x00000100,  // detection is within radius of multiple objects
126  ID_MEAS_BLEND_OBJ        = 0x00000200,  // multiple detections within radius of object
127  ID_MEAS_WARP_USED        = 0x00000400,  // measurement used to find mean warp photometry
128  ID_MEAS_UNMASKED_ASTRO   = 0x00000800,  // measurement was not masked in final astrometry fit
129  ID_MEAS_BLEND_MEAS_X     = 0x00001000,  // detection is within radius of multiple objects across catalogs                 
130  ID_MEAS_ARTIFACT         = 0x00002000,  // detection is thought to be non-astronomical                                     
131  ID_MEAS_SYNTH_MAG        = 0x00004000,  // magnitude is synthetic
132  ID_MEAS_PHOTOM_UBERCAL   = 0x00008000,  // externally-supplied zero point from ubercal analysis
133  ID_MEAS_STACK_PRIMARY    = 0x00010000,  // this stack measurement is in the primary skycell
134  ID_MEAS_STACK_PHOT_SRC   = 0x00020000,  // this measurement supplied the stack photometry
135  ID_MEAS_ICRF_QSO         = 0x00040000,  // this measurement is an ICRF reference position
136  ID_MEAS_IMAGE_EPOCH      = 0x00080000,  // this measurement is registered to the image epoch (not tied to ref catalog epoch)
137  ID_MEAS_PHOTOM_PSF       = 0x00100000,  // this measurement is used for the mean psf mag
138  ID_MEAS_PHOTOM_APER      = 0x00200000,  // this measurement is used for the mean ap mag
139  ID_MEAS_PHOTOM_KRON      = 0x00400000,  // this measurement is used for the mean kron mag
140  ID_MEAS_MASKED_PSF       = 0x01000000,  // this measurement is masked based on IRLS weights for mean psf mag
141  ID_MEAS_MASKED_APER      = 0x02000000,  // this measurement is masked based on IRLS weights for mean ap mag
142  ID_MEAS_MASKED_KRON      = 0x04000000,  // this measurement is masked based on IRLS weights for mean kron mag
143  ID_MEAS_OBJECT_HAS_2MASS = 0x10000000,  // measurement comes from an object with 2mass data
144  ID_MEAS_OBJECT_HAS_GAIA  = 0x20000000,  // measurement comes from an object with gaia data
145  ID_MEAS_OBJECT_HAS_TYCHO = 0x40000000,  // measurement comes from an object with tycho data
146} DVOMeasureFlags;
147
148typedef enum {
149  ID_GALPHOT_FAIL_FIT       = 0x00000001, // fit failed to converge or was degenerate
150  ID_GALPHOT_TOO_FEW        = 0x00000002, // not enough points to fit the model
151  ID_GALPHOT_OUT_OF_RANGE   = 0x00000004, // fit minimum too far outside data range
152  ID_GALPHOT_BAD_ERROR      = 0x00000008, // invalid error (nan or inf)
153} DVOGalphotFlags;
154
155// XXX we used these names previously in markstar: replace with ID_MEAS_ARTIFACT
156// # define ID_MEAS_TRAIL        0x2000
157// # define ID_MEAS_GHOST        0x4000
158
159/* some subtle distinctions between the blend flags:
160   BLEND_IMAGE: the star on an image is matched with more
161   than one star in the catalog (image has worse seeing than catalog)
162   BLEND_CATALOG: the star in the catalog is matched with more
163   than one star on the image (image has better seeing than catalog)
164   CALIBRATED: relative photometry has been performed on this measurement
165   BLEND_IMAGE_NEIGHBOR: the star on an image is matched with more
166   than one star in the catalog, but not in the same catalog file.
167*/
168
169/** these names were previously used for Average flags in old (LONEOS-era) dvo versions
170  ID_BAD_OBJECT        = 0x00004000, // if all measurements are bad, set this bit
171  ID_MOVING            = 0x00008000, // is a moving object
172  ID_ROCK              = 0x0000a000, // 0x8000 + 0x2000
173  ID_GHOST             = 0x0000c001, // 0x8000 + 0x4000 + 0x0001
174  ID_TRAIL             = 0x0000c002, // 0x8000 + 0x4000 + 0x0002
175  ID_BLEED             = 0x0000c003, // 0x8000 + 0x4000 + 0x0003
176  ID_COSMIC            = 0x0000c004, // 0x8000 + 0x4000 + 0x0004
177**/
178
179/* Average.flags values -- these values are 32 bit (as of PS1_V1) */
180typedef enum {
181  ID_OBJ_FEW             = 0x00000001, // used within relphot: skip star
182  ID_OBJ_POOR            = 0x00000002, // used within relphot: skip star
183
184  // NOTE: bits used for object classification:
185  ID_OBJ_ICRF_QSO        = 0x00000004, // object IDed with known ICRF quasar (may have ICRF position measurement)
186  ID_OBJ_HERN_QSO_P60    = 0x00000008, // identified as likely QSO (Hernitschek et al 2015), P_QSO = 0.60
187  ID_OBJ_HERN_QSO_P05    = 0x00000010, // identified as possible QSO (Hernitschek et al 2015), P_QSO = 0.05
188  ID_OBJ_HERN_RRL_P60    = 0x00000020, // identified as likely  RR Lyra (Hernitschek et al 2015), P_RRLyra = 0.60
189  ID_OBJ_HERN_RRL_P05    = 0x00000040, // identified as possible RR Lyra (Hernitschek et al 2015), P_RRLyra = 0.05
190  ID_OBJ_HERN_VARIABLE   = 0x00000080, // identified as a variable based on ChiSq (Hernitschek et al 2015)
191  ID_OBJ_TRANSIENT       = 0x00000100, // identified as a non-periodic (stationary) transient
192  ID_OBJ_HAS_SOLSYS_DET  = 0x00000200, // identified with a known solar-system object (asteroid or other)
193  ID_OBJ_MOST_SOLSYS_DET = 0x00000400, // most detections from a known solar-system object
194
195  // NOTE: bits used for astrometry analysis
196  ID_OBJ_LARGE_PM        = 0x00000800, // star with large proper motion
197  ID_OBJ_RAW_AVE         = 0x00001000, // simple weighted average position was used (no IRLS fitting)
198  ID_OBJ_FIT_AVE         = 0x00002000, // average position was fitted
199  ID_OBJ_FIT_PM          = 0x00004000, // proper motion model was fitted
200  ID_OBJ_FIT_PAR         = 0x00008000, // parallax model was fitted
201  ID_OBJ_USE_AVE         = 0x00010000, // average position used (not PM or PAR)
202  ID_OBJ_USE_PM          = 0x00020000, // proper motion used (not AVE or PAR)
203  ID_OBJ_USE_PAR         = 0x00040000, // parallax used (not AVE or PM)
204  ID_OBJ_NO_MEAN_ASTROM  = 0x00080000, // mean astrometry could not be measured
205  ID_OBJ_STACK_FOR_MEAN  = 0x00100000, // stack position used for mean astrometry
206  ID_OBJ_MEAN_FOR_STACK  = 0x00200000, // mean astrometry could not be measured
207  ID_OBJ_BAD_PM          = 0x00400000, // failure to measure proper-motion model
208
209  // NOTE: bits used for photometry analysis
210  ID_OBJ_EXT             = 0x00800000, // extended in our data (eg, PS)
211  ID_OBJ_EXT_ALT         = 0x01000000, // extended in external data (eg, 2MASS)
212  ID_OBJ_GOOD            = 0x02000000, // good-quality measurement in our data (eg,PS)
213  ID_OBJ_GOOD_ALT        = 0x04000000, // good-quality measurement in  external data (eg, 2MASS)
214  ID_OBJ_GOOD_STACK      = 0x08000000, // good-quality object in the stack (> 1 good stack)
215  ID_OBJ_BEST_STACK      = 0x10000000, // the primary stack measurement are the best measurements
216  ID_OBJ_SUSPECT_STACK   = 0x20000000, // suspect object in the stack (> 1 good or suspect stack, < 2 good)
217  ID_OBJ_BAD_STACK       = 0x40000000, // good-quality object in the stack (> 1 good stack)
218} DVOAverageFlags;
219
220/* Secfilt.flags values -- these values are 32 bit (as of PS1_V1) */
221typedef enum {
222  ID_SECF_STAR_FEW      = 0x00000001, // used within relphot: skip star
223  ID_SECF_STAR_POOR     = 0x00000002, // used within relphot: skip star
224  ID_SECF_USE_SYNTH     = 0x00000004, // synthetic photometry used in average measurement
225  ID_SECF_USE_UBERCAL   = 0x00000008, // ubercal photometry used in average measurement
226  ID_SECF_HAS_PS1       = 0x00000010, // PS1 photometry used in average measurement
227  ID_SECF_HAS_PS1_STACK = 0x00000020, // PS1 stack photometry exists
228  ID_SECF_HAS_TYCHO     = 0x00000040, // Tycho photometry used for synth mags
229  ID_SECF_FIX_SYNTH     = 0x00000080, // synth mags repaired with zpt map
230  ID_SECF_RANK_0        = 0x00000100, // average magnitude uses rank 0 values
231  ID_SECF_RANK_1        = 0x00000200, // average magnitude uses rank 1 values
232  ID_SECF_RANK_2        = 0x00000400, // average magnitude uses rank 2 values
233  ID_SECF_RANK_3        = 0x00000800, // average magnitude uses rank 3 values
234  ID_SECF_RANK_4        = 0x00001000, // average magnitude uses rank 4 values
235  ID_SECF_OBJ_EXT_PSPS  = 0x00002000, // In PSPS ID_SECF_OBJ_EXT is moved here so it fits within 16 bits
236  ID_SECF_STACK_PRIMARY = 0x00004000, // PS1 stack photometry comes from primary skycell
237  ID_SECF_STACK_BESTDET = 0x00008000, // PS1 stack best measurement is a detection (not forced)
238  ID_SECF_STACK_PRIMDET = 0x00010000, // PS1 stack primary measurement is a detection (not forced)
239
240  ID_SECF_HAS_SDSS      = 0x00100000, // this photcode has SDSS photometry
241  ID_SECF_HAS_HSC       = 0x00200000, // this photcode has HSC  photometry
242  ID_SECF_HAS_CFH       = 0x00400000, // this photcode has CFH  photometry (mostly Megacam)
243  ID_SECF_HAS_DES       = 0x00800000, // this photcode has DES  photometry
244
245  ID_SECF_OBJ_EXT       = 0x01000000, // extended in this band
246
247  ID_SECF_CHIP_FLAGS    = 0x01003f1f, // all chip-related bits (used to reset the correct bits only)
248  ID_SECF_STACK_FLAGS   = 0x00004020, // all stack-related bits (
249} DVOSecfiltFlags;
250
251/* definitions for parallel dvo host information
252   XXX : need better names (safer namespace)
253*/
254
255typedef enum {
256  DATA_ON_TGT  = 0x01,
257  DATA_ON_BCK  = 0x02,
258  DATA_USE_BCK = 0x04,
259
260  DATA_COPY_FAILURE = 0x80,
261} SkyTableDataFlags;
262
263typedef enum {
264  HOST_STDIN = 0,
265  HOST_STDOUT = 1,
266  HOST_STDERR = 2,
267} HostInfoIOfd;
268
269/*** general dvo structures (internal use only / not IO) ***/
270
271/* FITS DB structure */
272typedef struct {
273  FILE  *f;
274  char  *filename;
275  double timeout;
276  Header header;
277  Matrix matrix;
278  Header theader;
279  FTable ftable;
280  VTable vtable;
281  int    dbstate;
282  char   lockstate;
283  char   mode;          /* what data storage mode is used for disk file? */
284  DVOCatFormat format;  /* what data format is used for disk file? */
285  char   virtual;       /* is table in ftable or vtable? */
286  char   nativeOrder;   /* is table in internal byte-order? */
287  char   scaledValue;   /* is table in internal byte-order? */
288} FITS_DB;
289
290/* the basic HST GSC layout corresponds to a depth of 3 */
291# define SKY_DEPTH_HST 3
292
293/* SkyRegion : better implementation than GSCRegion */
294typedef struct {
295  off_t Nregions;
296  off_t Nalloc;
297  char **filename;
298  SkyRegion *regions;
299  char hosts[80];
300} SkyTable;
301
302typedef struct {
303  off_t Nregions;
304  int ownElements;                                /* does this list own filename, regions? */
305  char **filename;
306  SkyRegion **regions;
307  char hosts[80];
308} SkyList;
309
310typedef struct {
311  off_t Nimage;
312  FlatCorrectionImage *image;
313  off_t Ncorr;
314  int *IDtoSeq;
315  FlatCorrection *corr;
316  float ***offset; // the correction images represented as a set of arrays (same sequence as *image)
317  int Nseason;
318  e_time *tstart;
319  e_time *tstop;
320} FlatCorrectionTable;
321
322typedef struct {
323  char *hostname;             // name of remote machine
324  char *pathname;             // name of directory for this machine's data
325  char *results;              // name of file machine's result data
326  int hostID;                 // remove machine ID in SkyTable
327  int stdio[3];               // fd's for communication with the remote host
328  int pid;                    // remote process ID
329  int status;                 // job exit status
330  IOBuffer stdout;
331  IOBuffer stderr;
332} HostInfo;
333
334typedef struct {
335  int Nhosts;
336  HostInfo *hosts;
337  short *index;
338} HostTable;
339
340typedef struct {
341  int Nhosts;
342  HostInfo **hosts;
343} HostTableGroup;
344
345// A RegionHost processes data for some region in parallel with other regions
346typedef struct RegionHostInfo {
347  double Rmin;        // (Rmin,Rmax),(Dmin,Dmax) arehard RA,DEC boundaries of the
348  double Rmax;        // region for which each host is responsible.  A given host
349  double Dmin;        // calibrates the images for which the fiducial point (center)
350  double Dmax;        // lands in the region, and all objects in the region
351
352  double RminCat;      // (RminCat,RmaxCat),(DminCat,DmaxCat) are the region for which
353  double RmaxCat;      // the catalogs need to be loaded : this is the outer bounds
354  double DminCat;      // of the region containing all images completely
355  double DmaxCat;
356
357  char *hostname;
358
359  int hostID;                 // remove machine ID in SkyTable
360  int stdio[3];               // fd's for communication with the remote host
361  int pid;                    // remote process ID
362  int status;
363  IOBuffer stdout;
364  IOBuffer stderr;
365
366  off_t Nimage;
367  off_t NIMAGE;
368  Image *image;
369  off_t *imseq;
370
371  AstromOffsetTable *astromTable;
372
373  int *neighbors;             // list of neighbor index values
374  int Nneighbors;             // number of neighbors
375  char isNeighbor;            // TRUE if I am a neighbor to the current region host
376} RegionHostInfo;
377
378typedef struct {
379  double Rmin;
380  double Rmax;
381  double Dmin;
382  double Dmax;
383
384  int Nhosts;
385  RegionHostInfo *hosts;
386  short *index;
387} RegionHostTable;
388
389// special-case function:
390CMF_PS1_V2 *gfits_table_get_CMF_PS1_V1_Alt (FTable *ftable, off_t *Ndata, char *swapped);
391CMF_PS1_SV1 *gfits_table_get_CMF_PS1_SV1_Alt (FTable *ftable, off_t *Ndata, char *swapped);
392
393// another special case : does not match byte-boundaries
394# include "cmf-ps1-dv3.h"
395# include "cmf-ps1-sv3.h"
396# include "cmf-ps1-sv4.h"
397# include "cmf-ps1-v5.h"
398# include "cmf-ps1-v5-r0-lensing.h"
399# include "cmf-ps1-v5-r1-lensing.h"
400# include "cmf-ps1-v5-r2-lensing.h"
401
402typedef struct {
403  int Ncode;                                      // number of photcodes
404  int Nsecfilt;                                   // number of average magnitudes
405  int hashcode[0x10000];                  // index from photcode value to sequence
406  int hashNsec[0x10000];                  // index from photcode value to Nsec seq
407  int codeNsec[0x10000];                  // index from Nsec seq to photcode value
408  PhotCode *code;
409} PhotCodeData;
410
411typedef enum {
412  DVO_TV_MEASURE = 0x01,
413  DVO_TV_AVERAGE = 0x02,
414} DVOTinyValueMode;
415
416# define BOUNDARY_TREE_NAME_LENGTH 128
417
418// BoundaryTree is a structure to describe the 3pi RINGS skycell boundaries in terms of lines of constant (RA,DEC)
419// the structure is flexible for a variety of RINGS-like tessellations, but is not appropriate for the LOCAL style tess
420typedef struct {
421  int FixedGridDEC;           // is the DEC sequence linear?
422  int FixedGridRA;            // in the RA sequence in a zone linear?
423
424  double DEC_origin;
425  double DEC_offset;
426
427  int Nzone;
428  double *RA_origin;
429  double *RA_offset;
430  double *DEC_min;
431  double *DEC_max;
432  double *DEC_min_raw;
433  double *DEC_max_raw;
434
435  int *Nband;
436  int *NBAND;
437
438  double   **ra; // RA of projection cell center
439  double  **dec; // DEC of projection cell center
440  int    **cell; // zone,band -> proj cell sequence
441  int    **projID; // zone,band -> proj cell ID
442  char  ***name; // projection cell name
443 
444  float NX_SUB;
445  float NY_SUB;
446  double dPix;
447
448  double **Xo;
449  double **Yo;
450  float **dX;
451  float **dY;
452} BoundaryTree;
453
454typedef enum { TESS_NONE, TESS_LOCAL, TESS_RINGS } TessType;
455
456// TessellationTable is a structure to describe the parameters of a set of "tessellations"
457// (these are not strictly tessellations but projection sets as only the non-local
458// versions can cover the full sky).  For LOCAL projection cells, the structure describes
459// the boundaries of a SINGLE projection cell with Nx * Ny skycells and includes some
460// basic parameters (not used by the fullsky, eg RINGS, tessellations)
461typedef struct {
462  double Rmin; // this tessellation is valid only for RA >= Rmin
463  double Rmax; // this tessellation is valid only for RA <  Rmax
464  double Dmin; // this tessellation is valid only for DEC >= Dmin
465  double Dmax; // this tessellation is valid only for DEC <  Dmax
466
467  double Xo;
468  double Yo;
469  double Ro;
470  double Do;
471  double dPix;
472  float dX;
473  float dY;
474
475  float NX_SUB;
476  float NY_SUB;
477
478  char *basename;
479  int Nbasename;
480  int projectIDoff;
481  int skycellIDoff;
482
483  TessType type; //
484  BoundaryTree *tree;
485} TessellationTable;
486
487// a reduced-subset structure for relphot
488typedef struct {
489  double         R;
490  double         D;
491  unsigned short Nmeasure;
492  int            measureOffset;
493  uint32_t       flags;
494  int            catID;
495  int            objID;
496  int            nOwn;
497} AverageTiny;
498
499// a reduced-subset structure for relphot & relastro
500typedef struct {
501  double         R;
502  double         D;
503  float          M;
504  float          Mcal;
505  float          Mflat;
506  float          dM;
507  float          airmass;
508  float          Xccd;
509  float          Yccd;
510  float          Xfix;
511  float          Yfix;
512  float          dt;
513  float          psfQF;
514  int            t;
515  unsigned int   averef;
516  unsigned int   imageID;
517  unsigned int   dbFlags;
518  unsigned int   photFlags;
519  int            catID; // unsigned int?
520  unsigned short photcode;
521  short          dXccd;
522  short          dYccd;
523  short          dRsys;
524  char           myDet;
525} MeasureTiny;
526
527// alternate version of PS1_V4 (old dev version)
528typedef struct {
529  double           R;                    // RA (decimal degrees )
530  double           D;                    // DEC (decimal degrees )
531  float            dR;                   // RA error (arcsec)
532  float            dD;                   // DEC error (arcsec)
533  float            uR;                   // RA*cos(D) proper-motion (arcsec/year)
534  float            uD;                   // DEC proper-motion (arcsec/year)
535  float            duR;                  // RA*cos(D) p-m error (arcsec/year)
536  float            duD;                  // DEC p-m error (arcsec/year)
537  float            P;                    // parallax (arcsec)
538  float            dP;                   // parallax error (arcsec)
539  float            ChiSqAve;             // astrometry analysis chisq
540  float            ChiSqPM;              // astrometry analysis chisq
541  float            ChiSqPar;             // astrometry analysis chisq
542  int              Tmean;                // mean epoch (PM,PAR ref) (unix time seconds)
543  int              Trange;               // mean epoch (PM,PAR ref) (unix time seconds)
544  float            Xp;                   // unused
545  unsigned short   Npos;                 // number of detections used for astrometry
546  unsigned short   Nmeasure;             // number of psf measurements
547  unsigned short   Nmissing;             // number of missings
548  unsigned short   Ngalphot;            // number of extended measurements
549  uint32_t         measureOffset;        // offset to first psf measurement
550  uint32_t         missingOffset;        // offset to first missing obs
551  float            refColor;            // offset to first extended measurement
552  uint32_t         flags;                // average object flags (star; ghost; etc)
553  uint32_t         photFlagsUpper;       // upper bit of 2 bit summary of per-measure photflags
554  uint32_t         photFlagsLower;       // lower bit of 2 bit summary of per-measure photflags
555  unsigned int     objID;                // unique ID for object in table
556  unsigned int     catID;                // unique ID for table in which object was first realized
557  uint64_t         extID;                // external ID for object (eg PSPS objID)
558} Average_PS1_V4alt;
559
560Average_PS1_V4alt *gfits_table_get_Average_PS1_V4alt (FTable *table, off_t *Ndata, char *swapped);
561Average *Average_PS1_V4alt_ToInternal (Average_PS1_V4alt *in, off_t Nvalues);
562
563// alternate version of PS1_V4 (old dev version)
564typedef struct {
565  float            dR;                   // RA offset (arcsec)
566  float            dD;                   // DEC offset (arcsec)
567  float            M;                    // catalog mag (mag)
568  float            Mcal;                 // image cal mag (mag)
569  float            Map;                  // aperture mag (mag)
570  float            Mkron;                // kron magnitude (mag)
571  float            dMkron;               // kron magnitude error (mag)
572  float            dM;                   // mag error (mag)
573  float            dMcal;                // systematic calibration error (mag)
574  float            dt;                   // exposure time (2.5*log(exptime))
575  float            FluxPSF;              // flux from psf fit (counts/sec?)
576  float            dFluxPSF;             // error on psf flux (counts/sec?)
577  float            FluxKron;             // flux from kron ap (counts/sec?)
578  float            dFluxKron;            // error on kron flux (counts/sec?)
579  float            airmass;              // (airmass - 1) (airmass)
580  float            az;                   // telescope azimuth
581  float            Xccd;                 // X coord on chip (raw value) (pixels)
582  float            Yccd;                 // Y coord on chip (raw value) (pixels)
583  float            Sky;                  // local estimate of sky flux (counts/sec)
584  float            dSky;                 // local estimate of sky flux (counts/sec)
585  int              t;                    // time in seconds (UNIX)
586  unsigned int     averef;               // reference to average entry     
587  unsigned int     detID;                // detection ID
588  unsigned int     imageID;              // reference to DVO image ID
589  unsigned int     objID;                // unique ID for object in table
590  unsigned int     catID;                // unique ID for table in which object was first realized
591  uint64_t         extID;                // external ID (eg PSPS detID)
592  float            psfQF;                // psf coverage/quality factor
593  float            psfQFperf;            // psf coverage / quality factor (all mask bits)
594  float            psfChisq;             // psf fit chisq
595  int              psfNdof;              // psf degrees of freedom
596  int              psfNpix;              // psf number of pixels
597  float            crNsigma;             // Nsigma deviation towards CR
598  float            extNsigma;            // Nsigma deviation towards EXT
599  short            FWx;                  // object fwhm major axis (1/100 of pixels)
600  short            FWy;                  // object fwhm minor axis (1/100 of pixels )
601  short            theta;                // angle wrt ccd X dir ((0xffff/360) deg)
602  short            Mxx;                  // second moments in pixel coords (1/100 of pixels)
603  short            Mxy;                  // second moments in pixel coords (1/100 of pixels)
604  short            Myy;                  // second moments in pixel coords (1/100 of pixels)
605  unsigned short   t_msec;               // time fraction of second (milliseconds)
606  unsigned short   photcode;             // photcode
607  short            dXccd;                // X coord error on chip (1/100 of pixels)
608  short            dYccd;                // Y coord error on chip (1/100 of pixels)
609  short            dRsys;                // systematic error from astrom (1/100 of pixels)
610  short            posangle;             // position angle sky to chip ((0xffff/360) deg)
611  float            pltscale;             // plate scale (arcsec/pixel)
612  unsigned int     dbFlags;              // flags supplied by analysis in database
613  unsigned int     photFlags;            // flags supplied by photometry program
614} Measure_PS1_V4alt;
615
616Measure_PS1_V4alt *gfits_table_get_Measure_PS1_V4alt (FTable *table, off_t *Ndata, char *swapped);
617Measure *Measure_PS1_V4alt_ToInternal (Average *ave, Measure_PS1_V4alt *in, off_t Nvalues);
618
619typedef struct {
620  double           R;                    // RA at epoch (degrees)
621  double           D;                    // DEC at epoch (degrees)
622  float            M;                    // catalog mag (mag)
623  float            dM;                   // mag error (mag)
624  float            Map;                  // aperture mag (mag)
625  float            dMap;                 // aperture mag (mag)
626  float            Mkron;                // kron magnitude (mag)
627  float            dMkron;               // kron magnitude error (mag)
628  float            Mcal;                 // image cal mag (mag)
629  float            dMcal;                // systematic calibration error (mag)
630  float            dt;                   // exposure time (2.5*log(exptime))
631  float            FluxPSF;              // flux from psf fit (counts/sec)
632  float            dFluxPSF;             // error on psf flux (counts/sec)
633  float            FluxKron;             // flux from kron ap (counts/sec)
634  float            dFluxKron;            // error on kron flux (counts/sec)
635  float            FluxAp;               // flux from ap ap (counts/sec)
636  float            dFluxAp;              // error on ap flux (counts/sec)
637  float            airmass;              // (airmass - 1) (airmass)
638  float            az;                   // telescope azimuth
639  float            Xccd;                 // X coord on chip (raw value) (pixels)
640  float            Yccd;                 // Y coord on chip (raw value) (pixels)
641  float            Xfix;                 // X coord after correction (pixels)
642  float            Yfix;                 // Y coord after correction (pixels)
643  float            XoffKH;               // X offset from correction (pixels)
644  float            YoffKH;               // Y offset from correction (pixels)
645  float            XoffDCR;              // X offset from correction (pixels)
646  float            YoffDCR;              // Y offset from correction (pixels)
647  float            Mflat;                // flat offset from correction (arcsec)
648  int              padding2;             // dummy
649  float            Sky;                  // local estimate of sky flux (counts/sec)
650  float            dSky;                 // local estimate of sky flux (counts/sec)
651  int              t;                    // time in seconds (UNIX)
652  unsigned int     averef;               // reference to average entry     
653  unsigned int     detID;                // detection ID
654  unsigned int     objID;                // unique ID for object in table
655  unsigned int     catID;                // unique ID for table in which object was first realized
656  uint64_t         extID;                // external ID (eg PSPS detID)
657  unsigned int     imageID;              // reference to DVO image ID
658  float            psfQF;                // psf coverage/quality factor
659  float            psfQFperf;            // psf coverage / quality factor (all mask bits)
660  float            psfChisq;             // psf fit chisq
661  int              psfNdof;              // psf degrees of freedom
662  int              psfNpix;              // psf number of pixels
663  int              photFlags2;           // flags supplied by photometry program
664  float            extNsigma;            // Nsigma deviation towards EXT
665  short            FWx;                  // object fwhm major axis (1/100 of pixels)
666  short            FWy;                  // object fwhm minor axis (1/100 of pixels )
667  short            theta;                // angle wrt ccd X dir ((0xffff/360) deg)
668  short            Mxx;                  // second moments in pixel coords (1/100 of pixels)
669  short            Mxy;                  // second moments in pixel coords (1/100 of pixels)
670  short            Myy;                  // second moments in pixel coords (1/100 of pixels)
671  unsigned short   t_msec;               // time fraction of second (milliseconds)
672  unsigned short   photcode;             // photcode
673  short            dXccd;                // X coord error on chip (1/100 of pixels)
674  short            dYccd;                // Y coord error on chip (1/100 of pixels)
675  short            dRsys;                // systematic error from astrom (1/100 of pixels)
676  short            posangle;             // position angle sky to chip ((0xffff/360) deg)
677  float            pltscale;             // plate scale (arcsec/pixel)
678  unsigned int     dbFlags;              // flags supplied by analysis in database
679  unsigned int     photFlags;            // flags supplied by photometry program
680  int              padding;              // padding to ensure 8byte blocks
681} Measure_PS1_V5alt;
682
683Measure *Measure_PS1_V5alt_ToInternal (Average *ave, Measure_PS1_V5alt *in, off_t Nvalues);
684int gfits_convert_Measure_PS1_V5alt (Measure_PS1_V5alt *data, off_t size, off_t nitems);
685Measure_PS1_V5alt *gfits_table_get_Measure_PS1_V5alt (FTable *ftable, off_t *Ndata, char *swapped);
686
687// alternate version of PS1_V5 (old dev version)
688typedef struct {
689  float            M;                    // average mag in this band (mags)
690  float            dM;                   // formal error on average mag (mags)
691  float            Map;                  // ave aperture mag in this band (mags)
692  float            dMap;                 // ave aperture mag in this band (mags)
693  float            sMap;                 // standard deviation of ap mags (mags)
694  float            Mkron;                // ave kron mag in this band (mags)
695  float            dMkron;               // formal error on average kron mag (mags)
696  float            sMkron;               // standard deviation of kron mags (mags)
697  float            Mstdev;               // standard deviation of measurements (mags)
698  float            Mmin;                 // min accepted mag (mags)
699  float            Mmax;                 // max accepted mag (mags)
700  float            Mchisq;               // chisq on average mag (value)
701  short            Ncode;                // number of detections in band
702  short            Nused;                // number of detections used in average
703  short            NusedKron;            // number of detections used in average
704  short            NusedAp;              // number of detections used in average
705  uint32_t         flags;                // photometry flags
706  float            MpsfStk;              // magnitude from stack (primary if available)
707  float            FpsfStk;              // flux from stack (primary if available)
708  float            dFpsfStk;             // mean flux psf error
709  float            MkronStk;             // magnitude from stack (primary if available)
710  float            FkronStk;             // flux from stack (primary if available)
711  float            dFkronStk;            // mean flux kron error
712  float            MapStk;               // magnitude from stack (primary if available)
713  float            FapStk;               // flux from stack (primary if available)
714  float            dFapStk;              // mean flux ap error
715  int              stackPrmryOff;        // measure entry which is primary stack detection
716  int              stackBestOff;         // measure entry which is best stack detection
717  float            MpsfWrp;              // psf magnitude from stack (primary if available)
718  float            FpsfWrp;              // psf flux from stack (primary if available)
719  float            dFpsfWrp;             // mean flux psf error
720  float            sFpsfWrp;             // mean flux psf stdev
721  float            MkronWrp;             // kron magnitude from stack (primary if available)
722  float            FkronWrp;             // kron flux from stack (primary if available)
723  float            dFkronWrp;            // mean flux kron error
724  float            sFkronWrp;            // mean flux kron stdev
725  float            MapWrp;               // aper magnitude from stack (primary if available)
726  float            FapWrp;               // aper flux from stack (primary if available)
727  float            dFapWrp;              // mean flux ap error
728  float            sFapWrp;              // mean flux ap stdev
729  short            NusedWrp;             // number of detections used in average
730  short            NusedKronWrp;         // number of detections used in average
731  short            NusedApWrp;           // number of detections used in average
732  short            ubercalDist;          // number of images from an ubercal-image
733} SecFilt_PS1_V5alt;
734
735SecFilt_PS1_V5alt *gfits_table_get_SecFilt_PS1_V5alt (FTable *table, off_t *Ndata, char *swapped);
736int      gfits_convert_SecFilt_PS1_V5alt (SecFilt_PS1_V5alt *data, off_t size, off_t nitems);
737SecFilt *SecFilt_PS1_V5alt_ToInternal (SecFilt_PS1_V5alt *in, off_t Nvalues);
738
739// alternate version of PS1_V5alt (old dev version)
740typedef struct {
741  double           R;                    // RA (decimal degrees )
742  double           D;                    // DEC (decimal degrees )
743  float            dR;                   // RA error (arcsec)
744  float            dD;                   // DEC error (arcsec)
745  float            uR;                   // RA*cos(D) proper-motion (arcsec/year)
746  float            uD;                   // DEC proper-motion (arcsec/year)
747  float            duR;                  // RA*cos(D) p-m error (arcsec/year)
748  float            duD;                  // DEC p-m error (arcsec/year)
749  float            P;                    // parallax (arcsec)
750  float            dP;                   // parallax error (arcsec)
751  double           Rstk;                 // RA on stack (decimal degrees )
752  double           Dstk;                 // DEC on stack (decimal degrees )
753  float            dRstk;                // RA error on stack (arcsec)
754  float            dDstk;                // DEC error on stack (arcsec)
755  float            ChiSqAve;             // astrometry analysis chisq
756  float            ChiSqPM;              // astrometry analysis chisq
757  float            ChiSqPar;             // astrometry analysis chisq
758  int              Tmean;                // mean epoch (PM,PAR ref) (unix time seconds)
759  int              Trange;               // mean epoch (PM,PAR ref) (unix time seconds)
760  float            psfQF;                // psf coverage (bad masks)
761  float            psfQFperf;            // psf coverage (all masks)
762  float            stargal;              // star / galaxy separator (1/100 arcsec)
763  unsigned short   Npos;                 // number of detections used for astrometry
764  unsigned short   Nmeasure;             // number of psf measurements
765  unsigned short   Nmissing;             // number of missings
766  unsigned short   Nlensing;             // number of lensing measurements
767  unsigned short   Nlensobj;             // number of lensing measurements
768  unsigned short   Ngalphot;            // number of galphot measurements
769  int              measureOffset;        // offset to first psf measurement
770  int              missingOffset;        // offset to first missing obs
771  int              lensingOffset;        // offset to first lensing obs
772  int              lensobjOffset;        // offset to mean lensing data
773  int              galphotOffset;       // offset to extended object entry
774  int              starparOffset;        // offset to stellar parameter data
775  float            refColorBlue;         // color of astrometry ref stars
776  float            refColorRed;          // color of astrometry ref stars
777  uint32_t         flags;                // average object flags (star; ghost; etc)
778  uint32_t         photFlagsUpper;       // upper bit of 2 bit summary of per-measure photflags
779  uint32_t         photFlagsLower;       // lower bit of 2 bit summary of per-measure photflags
780  unsigned int     objID;                // unique ID for object in table
781  unsigned int     catID;                // unique ID for table in which object was first realized
782  uint64_t         extID;                // external ID for object (eg PSPS objID)
783  uint64_t         extIDgc;              // external ID for object in galactic coords
784} Average_PS1_V5alt;
785
786Average_PS1_V5alt *gfits_table_get_Average_PS1_V5alt (FTable *table, off_t *Ndata, char *swapped);
787int      gfits_convert_Average_PS1_V5alt (Average_PS1_V5alt *data, off_t size, off_t nitems);
788Average *Average_PS1_V5alt_ToInternal (Average_PS1_V5alt *in, off_t Nvalues);
789
790/* for some reason I have merged the set of tables and the file description,
791   so I need to have an internal structure to point to the separate files */
792
793/* a catalog contains this data */
794typedef struct Catalog {
795  char *filename;                       /* catalog file */
796  FILE *f;                              /* file descriptor */
797  Header  header;
798
799  /* data in the catalog file */
800  Average *average;
801  Measure *measure; 
802  Missing *missing; 
803  SecFilt *secfilt;
804
805  // lensing data (optional?)
806  Lensing  *lensing;
807  Lensobj  *lensobj;
808  StarPar  *starpar;
809  GalPhot *galphot;
810
811  int Nsecfilt;  /* number of secfilt entries for each average entry */
812  off_t Naverage,      Nmeasure,      Nmissing,      Nlensing,      Nlensobj,      Nstarpar,      Ngalphot,      Nsecfilt_mem;  /* current number of each component in memory */
813  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 */
814  off_t Naverage_off,  Nmeasure_off,  Nmissing_off,  Nlensing_off,  Nlensobj_off,  Nstarpar_off,  Ngalphot_off,  Nsecfilt_off;  /* index of first loaded data value */
815
816  // note that we use these for the full-sky relphot analysis
817  AverageTiny *averageT;
818  MeasureTiny *measureT; 
819
820  /* the Nsecf_* values above are number of table rows (eg, Naverage*Nsecfilt) */
821
822  /* note the different counting for Nsecfilt:
823     number of secfilt rows on disk is: Nave_disk * Nsecfilt
824     number of secfilt rows in mem  is: Naverage * Nsecfilt
825     *** that is just silly, and bad: convert to using Nsec_mem, Nsec_disk, Nsec_off.
826     *** unless we always require the secfilt and average entries to be loaded sychronously.
827     */
828
829  /* pointers to split data files */
830  struct Catalog *measure_catalog;              /* measure  catalog data (split) */
831  struct Catalog *missing_catalog;              /* missing  catalog data (split) */
832  struct Catalog *secfilt_catalog;              /* secfilt  catalog data (split) */
833  struct Catalog *lensing_catalog;              /* lensing  catalog data (split) */
834  struct Catalog *lensobj_catalog;              /* lensobj  catalog data (split) */
835  struct Catalog *starpar_catalog;              /* starpar  catalog data (split) */
836  struct Catalog *galphot_catalog;              /* galphot catalog data (split) */
837
838  unsigned int objID;
839  unsigned int catID;
840
841  /* extra catalog information */
842  char lockmode;
843  DVOCatMode     catmode;     /* storage mode (raw, mef, split, mysql) */
844  DVOCatFormat   catformat;                     /* storage format (elixir, panstarrs, etc) */
845  DVOCatCompress catcompress;                   // output compress mode
846  DVOCatFlags    catflags;                      /* choices to be loaded */
847 
848  int sorted;                           /* is measure table average-sorted? (NOTE this is an int only because gfits_scan %t requires it) */
849
850  /* pointers for data manipulation */
851  off_t *found_t;
852  off_t *foundWarp_t;
853
854  char *measureRank;
855  int   *nOwn_t; // relastro uses this to count owned detections per object
856
857} Catalog;
858
859/*** prototypes ***/
860
861/* in gfits_db.c */
862int   gfits_db_init                PROTO((FITS_DB *db));
863int   gfits_db_create              PROTO((FITS_DB *db));
864int   gfits_db_lock                PROTO((FITS_DB *db, char *filename));
865int   gfits_db_load                PROTO((FITS_DB *db));
866int   gfits_db_load_segment        PROTO((FITS_DB *db, off_t start, off_t Nrows));
867int   gfits_db_save                PROTO((FITS_DB *db));
868int   gfits_db_update              PROTO((FITS_DB *db));
869int   gfits_db_close               PROTO((FITS_DB *db));
870int   gfits_db_free                PROTO((FITS_DB *db));
871
872int gfits_fread_uncompressed (Catalog *catalog, FTable *ftable, char *nativeOrder, char VERBOSE);
873
874char *libdvo_version (void);
875
876int isRegisteredMosaic (void);
877off_t GetRegisteredMosaic (void);
878off_t *GetChipMatch (void);
879int GetMosaicCoords (Coords *coords);
880int FindMosaicForImage (Image *images, off_t Nimages, off_t entry);
881int FindMosaicForImage_TableSearch (Image *images, off_t Nimages, off_t entry);
882int FindMosaicForImage_MatchSearch (Image *images, off_t Nimages, off_t entry);
883int BuildChipMatch (Image *images, off_t Nimages);
884void SetImageCorners (double *X, double *Y, Image *image);
885
886short int putMi (double value);
887double getMi (short int value);
888void returnMcal (Image *image, double *c);
889void assignMcal (Image *image, double *c, int order);
890double applyMcal (Image *image, double x, double y);
891double findscatter (double *X, double *Y, double *M, double *dM, int N, double *c, int order);
892
893PhotCode *GetPhotcodebyName (char *name);
894PhotCode *GetPhotcodeEquivbyName (char *name);
895PhotCode *GetPhotcodebyCode (int code);
896PhotCode *GetPhotcodebyNsec (int Nsec);
897PhotCode *GetPhotcodeEquivbyCode (int code);
898char     *GetPhotcodeNamebyCode (int code);
899
900float PhotInst (Measure *measure, dvoMagClassType class);
901float PhotCat (Measure *measure, dvoMagClassType class);
902float PhotSys (Measure *measure, Average *average, SecFilt *secfilt, dvoMagClassType class);
903float PhotRel (Measure *measure, Average *average, SecFilt *secfilt, dvoMagClassType class);
904float PhotCal (Measure *thisone, Average *average, SecFilt *secfilt, Measure *measure, PhotCode *code, dvoMagClassType class);
905float PhotErr (Measure *measure, dvoMagClassType class);
906float PhotCalErr (Measure *measure, dvoMagClassType class);
907
908float PhotAve (PhotCode *code, Average *average, SecFilt *secfilt, dvoMagClassType class, dvoMagSourceType source);
909float PhotRef (PhotCode *code, Average *average, SecFilt *secfilt, Measure *measure, dvoMagClassType class, dvoMagSourceType source);
910float PhotAveErr (PhotCode *code, Average *average, SecFilt *secfilt, dvoMagClassType class, dvoMagSourceType source);
911
912float PhotInstTiny (MeasureTiny *measure, dvoMagClassType class);
913float PhotCatTiny (MeasureTiny *measure, dvoMagClassType class);
914float PhotSysTiny (MeasureTiny *measure, AverageTiny *average, SecFilt *secfilt, dvoMagClassType class);
915float PhotRelTiny (MeasureTiny *measure, AverageTiny *average, SecFilt *secfilt, dvoMagClassType class);
916float PhotCalTiny (MeasureTiny *thisone, AverageTiny *average, SecFilt *secfilt, MeasureTiny *measure, PhotCode *code, dvoMagClassType class);
917
918float PhotAveTiny (PhotCode *code, AverageTiny *average, SecFilt *secfilt, dvoMagClassType class, dvoMagSourceType source);
919float PhotRefTiny (PhotCode *code, AverageTiny *average, SecFilt *secfilt, MeasureTiny *measure, dvoMagClassType class, dvoMagSourceType source);
920
921float PhotFluxInst (Measure *measure, dvoMagClassType class);
922float PhotFluxCat (Measure *measure, dvoMagClassType class);
923float PhotFluxSys (Measure *measure, Average *average, SecFilt *secfilt, dvoMagClassType class);
924float PhotFluxRel (Measure *measure, Average *average, SecFilt *secfilt, dvoMagClassType class);
925float PhotFluxCal (Measure *thisone, Average *average, SecFilt *secfilt, Measure *measure, PhotCode *code, dvoMagClassType class);
926
927float PhotFluxAve (PhotCode *code, Average *average, SecFilt *secfilt, dvoMagClassType class, dvoMagSourceType source);
928float PhotFluxRef (PhotCode *code, Average *average, SecFilt *secfilt, Measure *measure, dvoMagClassType class, dvoMagSourceType source);
929
930float PhotFluxInstErr (Measure *measure, dvoMagClassType class);
931float PhotFluxCatErr (Measure *measure, dvoMagClassType class);
932float PhotFluxAveErr (PhotCode *code, Average *average, SecFilt *secfilt, dvoMagClassType class, dvoMagSourceType source);
933float PhotFluxSysErr (Measure *measure, Average *average, SecFilt *secfilt, dvoMagClassType class);
934float PhotFluxRelErr (Measure *measure, Average *average, SecFilt *secfilt, dvoMagClassType class);
935
936float PhotXm (PhotCode *code, Average *average, SecFilt *secfilt);
937float PhotZeroPoint (Measure *measure, Average *average, SecFilt *secfilt);
938
939float PhotSecfiltPsfQf (PhotCode *code, Average *average, SecFilt *secfilt);
940float PhotSecfiltPsfQfPerfect (PhotCode *code, Average *average, SecFilt *secfilt);
941
942int   PhotSecfiltFlags (PhotCode *code, Average *average, SecFilt *secfilt);
943int   PhotNwarp (PhotCode *code, Average *average, SecFilt *secfilt);
944int   PhotNwarpGood (PhotCode *code, Average *average, SecFilt *secfilt);
945int   PhotNstack (PhotCode *code, Average *average, SecFilt *secfilt);
946int   PhotNstackDet (PhotCode *code, Average *average, SecFilt *secfilt);
947int   PhotNcode (PhotCode *code, Average *average, SecFilt *secfilt);
948int   PhotNphot (PhotCode *code, Average *average, SecFilt *secfilt, dvoMagClassType class, dvoMagSourceType source);
949float PhotMstdev (PhotCode *code, Average *average, SecFilt *secfilt, dvoMagClassType class, dvoMagSourceType source);
950float PhotMmin (PhotCode *code, Average *average, SecFilt *secfilt);
951float PhotMmax (PhotCode *code, Average *average, SecFilt *secfilt);
952float PhotUCdist (PhotCode *code, Average *average, SecFilt *secfilt);
953unsigned int PhotStackID (PhotCode *code, Average *average, SecFilt *secfilt);
954
955float PhotColorForCode (Average *average, SecFilt *secfilt, Measure *measure, PhotCode *code);
956int PhotColor (Average *average, SecFilt *secfilt, Measure *measure, int c1, int c2, double *color);
957
958float PhotXmTiny (PhotCode *code, AverageTiny *average, SecFilt *secfilt);
959float PhotdMTiny (PhotCode *code, AverageTiny *average, SecFilt *secfilt);
960
961float PhotColorForCodeTiny (AverageTiny *average, SecFilt *secfilt, MeasureTiny *measure, PhotCode *code);
962int PhotColorTiny (AverageTiny *average, SecFilt *secfilt, MeasureTiny *measure, int c1, int c2, double *color);
963
964PhotCodeData *GetPhotcodeTable (void);
965void SetPhotcodeTable (PhotCodeData *);
966void FreePhotcodeData (PhotCodeData *myPhotcodes);
967void FreePhotcodeTable (void);
968
969int *GetSecFiltMap(PhotCodeData *ouput, PhotCodeData* input);
970PhotCode **ParsePhotcodeList (char *rawlist, int *nphotcodes, int needAve);
971
972int LoadPhotcodes (char *catdir_file, char *master_file, int readwrite);
973int LoadPhotcodesText (char *filename);
974int LoadPhotcodesFITS (char *filename);
975int SavePhotcodesText (char *filename);
976int SavePhotcodesFITS (char *filename);
977
978void PrintPhotcodeNamebyCode (FILE *f, char *format, int code);
979
980int GetPhotcodeCodebyName (char *name);
981int GetPhotcodeEquivCodebyName (char *name);
982int GetPhotcodeEquivCodebyCode (int code);
983int GetPhotcodeNsec (int code);
984int GetPhotcodeNsecfilt (void);
985void SetZeroPoint (double ZP);
986double GetZeroPoint (void);
987int *GetPhotcodeEquivList (int code, int *nlist);
988void ParseColorTerms (char *terms, float *X, int *N);
989
990int get_image_type (char *name);
991char *get_type_name (int type);
992int get_image_mode (char *name);
993char *get_mode_name (int mode);
994
995/** dvo_catalog APIs */
996void dvo_catalog_init (Catalog *catalog, int complete);
997void dvo_catalog_create (SkyRegion *region, Catalog *catalog);
998void dvo_catalog_free (Catalog *catalog);
999void dvo_catalog_free_data (Catalog *catalog);
1000int dvo_catalog_check (Catalog *catalog, int Nsecfilt, int extend);
1001int dvo_catalog_lock (Catalog *catalog, int lockmode);
1002int dvo_catalog_unlock (Catalog *catalog);
1003int dvo_catalog_load (Catalog *catalog, int VERBOSE);
1004int dvo_catalog_open (Catalog *catalog, SkyRegion *region, int VERBOSE, char *iomode);
1005int dvo_catalog_save (Catalog *catalog, char VERBOSE);
1006int dvo_catalog_save_complete (Catalog *catalog, char VERBOSE);
1007int dvo_catalog_update (Catalog *catalog, char VERBOSE);
1008DVOCatFormat dvo_catalog_catformat (char *catformat);
1009DVOCatMode dvo_catalog_catmode (char *catmode);
1010DVOCatCompress dvo_catalog_catcompress (char *catcompress);
1011char *dvo_catalog_compress_string (DVOCatCompress catcompress);
1012void dvo_catalog_test (Catalog *catalog, int halt);
1013
1014int dvo_catalog_backup (Catalog *catalog, char *suffix, int primary);
1015int dvo_catalog_unlink_backup (Catalog *catalog, char *suffix, int primary);
1016
1017/* catmode-specific APIs */
1018int dvo_catalog_load_raw (Catalog *catalog, int VERBOSE);
1019int dvo_catalog_save_raw (Catalog *catalog, char VERBOSE);
1020int dvo_catalog_load_mef (Catalog *catalog, int VERBOSE);
1021int dvo_catalog_save_mef (Catalog *catalog, char VERBOSE);
1022int dvo_catalog_load_split (Catalog *catalog, int VERBOSE);
1023int dvo_catalog_save_split (Catalog *catalog, char VERBOSE);
1024int dvo_catalog_update_split (Catalog *catalog, char VERBOSE);
1025int dvo_catalog_save_split_complete (Catalog *catalog, char VERBOSE);
1026
1027int dvo_catalog_load_segment (Catalog *catalog, int VERBOSE, off_t start, off_t Nrows);
1028int dvo_catalog_load_segment_split (Catalog *catalog, int VERBOSE, off_t start, off_t Nrows);
1029
1030/*** conversion functions / I/O conversions ***/
1031Average *ReadRawAverage (FILE *f, off_t Naverage, char format, SecFilt **primary);
1032Measure *ReadRawMeasure (FILE *f, Average *average, off_t Nmeasure, char format);
1033SecFilt *ReadRawSecFilt (FILE *f, off_t Nsecfilt, char format);
1034int WriteRawAverage (FILE *f, Average *average, off_t Naverage, char format, SecFilt *primary);
1035int WriteRawMeasure (FILE *f, Average *average, Measure *measure, off_t Nmeasure, char format);
1036int WriteRawSecFilt (FILE *f, SecFilt *secfilt, off_t Nsecfilt, char format);
1037
1038DVOCatFormat FtableGetFormat (FTable *ftable);
1039
1040Average *FtableToAverage   (FTable *ftable, off_t *Naverage,  DVOCatFormat *format, SecFilt **primary, char nativeOrder);
1041
1042Measure *FtableToMeasure   (FTable *ftable, Average *average, off_t *Nmeasure,  DVOCatFormat *format, char nativeOrder);
1043Missing *FtableToMissing   (FTable *ftable, Average *average, off_t *Nmissing,  DVOCatFormat *format, char nativeBytes);
1044SecFilt *FtableToSecFilt   (FTable *ftable, Average *average, off_t *Nsecfilt,  DVOCatFormat *format, char nativeOrder);
1045Lensing *FtableToLensing   (FTable *ftable, Average *average, off_t *Nlensing,  DVOCatFormat *format, char nativeOrder);
1046Lensobj *FtableToLensobj   (FTable *ftable, Average *average, off_t *Nlensobj,  DVOCatFormat *format, char nativeOrder);
1047StarPar *FtableToStarPar   (FTable *ftable, Average *average, off_t *Nstarpar,  DVOCatFormat *format, char nativeOrder);
1048GalPhot *FtableToGalPhot (FTable *ftable, Average *average, off_t *Ngalphot, DVOCatFormat *format, char nativeOrder);
1049
1050int      FtableToImage   (FTable *ftable, Header *theader, DVOCatFormat *format);
1051
1052int MeasureToFtable  (FTable *ftable, Average  *average,  Measure *measure, off_t Nmeasure, DVOCatFormat format, int swapFromNative);
1053int AverageToFtable  (FTable *ftable, Average  *average,  off_t Naverage,  DVOCatFormat format, SecFilt *primary, int swapFromNative);
1054int SecFiltToFtable  (FTable *ftable, SecFilt  *secfilt,  off_t Nsecfilt,  DVOCatFormat format, int swapFromNative);
1055int LensingToFtable  (FTable *ftable, Lensing  *lensing,  off_t Nlensing,  DVOCatFormat format, int swapFromNative);
1056int LensobjToFtable  (FTable *ftable, Lensobj  *lensobj,  off_t Nlensobj,  DVOCatFormat format, int swapFromNative);
1057int StarParToFtable  (FTable *ftable, StarPar  *starpar,  off_t Nstarpar,  DVOCatFormat format, int swapFromNative);
1058int GalPhotToFtable (FTable *ftable, GalPhot *galphot, off_t Ngalphot, DVOCatFormat format, int swapFromNative);
1059
1060int ImageToFtable (FTable *ftable, Header *theader, DVOCatFormat format);
1061int ImageToVtable (VTable *vtable, Header *theader, DVOCatFormat format);
1062
1063# include "loneos_defs.h"
1064# include "elixir_defs.h"
1065# include "panstarrs_dev_0_defs.h"
1066# include "panstarrs_dev_1_defs.h"
1067# include "ps1_dev_1_defs.h"
1068# include "ps1_dev_2_defs.h"
1069# include "ps1_dev_3_defs.h"
1070# include "ps1_v1_defs.h"
1071# include "ps1_v2_defs.h"
1072# include "ps1_v3_defs.h"
1073# include "ps1_v4_defs.h"
1074# include "ps1_v5_defs.h"
1075# include "ps1_v5_ld_defs.h"
1076# include "ps1_ref_defs.h"
1077# include "ps1_sim_defs.h"
1078
1079/*** DVO image db I/O Functions ***/
1080int dvo_image_lock (FITS_DB *db, char *filename, double timeout, int lockstate);
1081int dvo_image_unlock (FITS_DB *db);
1082int dvo_image_load (FITS_DB *db, int VERBOSE, int FORCE_READ);
1083int dvo_image_save (FITS_DB *db, int VERBOSE);
1084int dvo_image_update (FITS_DB *db, int VERBOSE);
1085int dvo_image_load_raw (FITS_DB *db, int VERBOSE, int FORCE_READ);
1086int dvo_image_update_raw (FITS_DB *db, int VERBOSE);
1087int dvo_image_save_raw (FITS_DB *db, int VERBOSE);
1088int dvo_image_addrows (FITS_DB *db, Image *new, off_t Nnew);
1089int dvo_image_createID (Header *header);
1090void dvo_image_create (FITS_DB *db, double ZeroPoint);
1091
1092int gfits_table_set_Image (FTable *ftable);
1093int gfits_table_mkheader_Image (Header *header);
1094Image *gfits_table_get_Image (FTable *ftable, off_t *Ndata, char *scaledValue, char *nativeOrder);
1095
1096/* flatcorr APIs */
1097FlatCorrectionTable *FlatCorrectionLoad (char *filename, int VERBOSE);
1098int FlatCorrectionInternal(FlatCorrectionTable *flatcorrTable);
1099int FlatCorrectionSave (FlatCorrectionTable *flatcorrTable, char *filename);
1100float FlatCorrectionOffset (FlatCorrectionTable *flatcorr, int ID, int X, int Y);
1101
1102/* skyregion APIs */
1103int        SkyTableSave            PROTO((SkyTable *table, char *filename));
1104SkyTable  *SkyTableLoad            PROTO((char *filename, int VERBOSE));
1105char      *SkyTableFilename        PROTO((char *catdir));
1106SkyTable  *SkyTableFromGSC         PROTO((char *filename, int depth, int VERBOSE));
1107SkyTable  *SkyTableLoadOptimal     PROTO((char *catdir, char *SKYFILE, char *GSCFILE, int readwrite, int depth, int VERBOSE));
1108int        SkyTableSetDepth        PROTO((SkyTable *sky, int depth));
1109SkyList   *SkyListMatchList        PROTO((SkyList *inlist, char **cptlist, int Ncptlist));
1110SkyList   *SkyRegionByIndex        PROTO((SkyTable *table, int index));
1111SkyList   *SkyRegionByCPT          PROTO((SkyTable *table, char *filename));
1112SkyList   *SkyRegionByPoint        PROTO((SkyTable *table, int depth, double ra, double dec));
1113SkyList   *SkyListByPoint          PROTO((SkyTable *table, double ra, double dec));
1114SkyList   *SkyListByRadius         PROTO((SkyTable *table, int depth, double RA, double DEC, double radius));
1115SkyList   *SkyListByPatch          PROTO((SkyTable *table, int depth, SkyRegion *patch));
1116SkyList   *SkyListByName           PROTO((SkyTable *table, char *name));
1117SkyList   *SkyListByImage          PROTO((SkyTable *table, int depth, Image *image));
1118SkyList   *SkyListByBounds         PROTO((SkyTable *table, int depth, double Rmin, double Rmax, double Dmin, double Dmax));
1119SkyList   *SkyListChildrenByBounds PROTO((SkyTable *table, int No, int depth, double Rmin, double Rmax, double Dmin, double Dmax));
1120
1121int        SkyListMerge            PROTO((SkyList **outlist, SkyList *newlist));
1122int        SkyListFree             PROTO((SkyList *list));
1123int        SkyTableFree            PROTO((SkyTable *table));
1124int        SkyListSetFilenames     PROTO((SkyList *list, char *path, char *ext));
1125int        SkyTableSetFilenames    PROTO((SkyTable *sky, char *path, char *ext));
1126
1127SkyList   *SkyRegionByPoint_List   PROTO((SkyList *inList, int depth, double ra, double dec));
1128SkyList   *SkyListByBounds_List    PROTO((SkyList *table, int depth, double Rmin, double Rmax, double Dmin, double Dmax));
1129SkyList   *SkyListChildrenByBounds_List PROTO((SkyList *table, int depth, double Rmin, double Rmax, double Dmin, double Dmax));
1130
1131int set_skyregion(double Rs, double Re, double Ds, double De);
1132int get_skyregion (double *Rs, double *Re, double *Ds, double *De);
1133
1134void dvo_set_catdir(char *catdir);
1135char *dvo_get_catdir();
1136
1137/* dvo-specific sorting functions */
1138void sortave (Average *ave, off_t N);
1139void sort_image_subset (Image *image, off_t *subset, off_t N);
1140void sort_coords_index (double *X, double *Y, off_t *S, off_t N);
1141void sort_coords_indexonly (double *X, double *Y, off_t *S, off_t N);
1142void sort_IDs_indexonly (opihi_int *X, off_t *S, off_t N);
1143void sort_regions (SkyRegion *region, off_t N);
1144
1145#ifdef MOVED_TO_LIBOHANA
1146int  print_error(void);
1147int  init_error(void);
1148int  push_error(char *);
1149#endif
1150
1151// functions for parallel DVO
1152int HostTableExists (char *catdir, char *rootname);
1153HostTable    *HostTableLoad (char *catdir, char *rootname);
1154int HostTableWaitJobs (HostTable *table, char *file, int lineno);
1155int HostTableWaitJobsGetIO (HostTable *table, char *file, int lineno, int VERBOSE);
1156int HostTableTestHost (SkyRegion *region, int hostID);
1157
1158void InitHost (HostInfo *host);
1159void FreeHostTable (HostTable *table);
1160void FreeHostTableGroup (HostTableGroup *table);
1161
1162HostTableGroup *HostTableGroupsUniqueMachines (HostTable *table, int *ngroups);
1163HostTableGroup *HostTableGroupsMaxNumber (HostTable *table, int *ngroups, int Nmax);
1164
1165int HostTableGroupWaitJobsGetIO (HostTableGroup *table, char *file, int lineno, int VERBOSE);
1166
1167// functions to support tiny versions of Average and Measure
1168void CopyAverageToTiny (AverageTiny *averageT, Average *average);
1169void CopyMeasureToTiny (MeasureTiny *measureT, Measure *measure);
1170int populate_tiny_values (Catalog *catalog, DVOTinyValueMode mode);
1171int free_tiny_values (Catalog *catalog);
1172
1173BoundaryTree *BoundaryTreeLoad(char *filename);
1174BoundaryTree *BoundaryTreeRead(Header *headerPHU, Header *headerZone, FILE *f);
1175void BoundaryTreeFree(BoundaryTree *tree);
1176
1177int BoundaryTreeSave(char *filename, BoundaryTree *tree);
1178int BoundaryTreeWrite(FILE *f, BoundaryTree *tree);
1179
1180int BoundaryTreeCellCoords (BoundaryTree *tree, int *zone, int *band, double ra, double dec);
1181int BoundaryTreeProjection (double *x, double *y, double r, double d, BoundaryTree *tree, int zone, int band);
1182
1183TessellationTable *TessellationTableLoad(char *filename, int *Ntess);
1184int TessellationTableSave(char *filename, TessellationTable *tess, int Ntess);
1185int TessellationPrimaryCellIDs (TessellationTable *tess, int Ntess, int *tessID, int *projID, int *skycellID, double ra, double dec);
1186void TessellationTableInit (TessellationTable *tess, int Ntess);
1187void TessellationTableFree (TessellationTable *tess, int Ntess);
1188
1189float dvoOffsetR (Measure *measure, Average *average);
1190float dvoOffsetD (Measure *measure, Average *average);
1191double dvoMeanR (float dR, Average *average);
1192double dvoMeanD (float dD, Average *average);
1193
1194void dvo_average_init (Average *average);
1195void dvo_averageT_init (AverageTiny *average);
1196void dvo_secfilt_init (SecFilt *secfilt, SecFiltInitMode mode);
1197void dvo_measure_init (Measure *measure);
1198void dvo_measureT_init (MeasureTiny *measure);
1199
1200void dvo_lensing_init (Lensing *lensing);
1201void dvo_lensobj_init (Lensobj *lensobj, int toZero);
1202void dvo_starpar_init (StarPar *starpar);
1203void dvo_galphot_init (GalPhot *galphot);
1204
1205void InitRegionHosts (RegionHostInfo *hosts, int Nhosts, int NHOSTS);
1206void FreeRegionHosts (RegionHostInfo *hosts, int Nhosts);
1207void FreeRegionHostTable (RegionHostTable *table);
1208RegionHostTable *RegionHostTableLoad (char *catdir, char *rootname);
1209int RegionHostTableWaitJobs (RegionHostTable *regionHosts, char *file, int lineno);
1210int RegionHostTableWaitJobsGetIO (RegionHostTable *regionHosts, char *file, int lineno, int VERBOSE);
1211int RegionHostFindNeighbors (RegionHostTable *table, int Nhost);
1212
1213// galaxy_model:
1214int TransformProperMotion_radians (double *uR, double *uD, double uL, double uB, double Rrad, double Drad, CoordTransform *transform);
1215int TransformProperMotionForewards (double *uL, double *uB, double uR, double uD, double R, double D, CoordTransform *transform);
1216int TransformProperMotionBackwards (double *uR, double *uD, double uL, double uB, double R, double D, CoordTransform *transform);
1217int SolarMotionModel_radians (double *uL_sol, double *uB_sol, double Lrad, double Brad, double distance);
1218int SolarMotionModel (double *uL_sol, double *uB_sol, double L, double B, double distance);
1219int GalaxyMotionModel_radians (double *uL_gal, double *uB_gal, double Lrad, double Brad);
1220int GalaxyMotionModel (double *uL_gal, double *uB_gal, double L, double B);
1221int InitGalaxyModel (char *version);
1222
1223# define LENSFIELD(NAME) float LensValue_##NAME (PhotCode *code, Lensobj *lensobj);
1224
1225LENSFIELD(X11_sm_obj)
1226LENSFIELD(X12_sm_obj)
1227LENSFIELD(X22_sm_obj)
1228LENSFIELD(E1_sm_obj)
1229LENSFIELD(E2_sm_obj)
1230
1231LENSFIELD(X11_sh_obj)
1232LENSFIELD(X12_sh_obj)
1233LENSFIELD(X22_sh_obj)
1234LENSFIELD(E1_sh_obj)
1235LENSFIELD(E2_sh_obj)
1236
1237LENSFIELD(X11_sm_psf)
1238LENSFIELD(X12_sm_psf)
1239LENSFIELD(X22_sm_psf)
1240LENSFIELD(E1_sm_psf)
1241LENSFIELD(E2_sm_psf)
1242
1243LENSFIELD(X11_sh_psf)
1244LENSFIELD(X12_sh_psf)
1245LENSFIELD(X22_sh_psf)
1246LENSFIELD(E1_sh_psf)
1247LENSFIELD(E2_sh_psf)
1248
1249LENSFIELD( F_ApR5)
1250LENSFIELD(dF_ApR5)
1251LENSFIELD(sF_ApR5)
1252LENSFIELD(fF_ApR5)
1253
1254LENSFIELD( F_ApR6)
1255LENSFIELD(dF_ApR6)
1256LENSFIELD(sF_ApR6)
1257LENSFIELD(fF_ApR6)
1258
1259LENSFIELD( F_ApR7)
1260LENSFIELD(dF_ApR7)
1261LENSFIELD(sF_ApR7)
1262LENSFIELD(fF_ApR7)
1263
1264LENSFIELD(E1)
1265LENSFIELD(E2)
1266
1267# undef LENSFIELD
1268
1269# define GALPHOT_FIELD(NAME, VALUE) float GalphotValue_##NAME (PhotCode *code, dvoMagClassType class, GalPhot *galphot, int Ngalphot)
1270
1271GALPHOT_FIELD(GAL_MAG,         mag);           
1272GALPHOT_FIELD(GAL_MAG_ERR,     magErr);   
1273GALPHOT_FIELD(GAL_MAJ,         majorAxis);             
1274GALPHOT_FIELD(GAL_MAJ_ERR,     majorAxisErr);
1275GALPHOT_FIELD(GAL_MIN,         minorAxis);             
1276GALPHOT_FIELD(GAL_MIN_ERR,     minorAxisErr);   
1277GALPHOT_FIELD(GAL_THETA,       theta);     
1278GALPHOT_FIELD(GAL_THETA_ERR,   thetaErr); 
1279GALPHOT_FIELD(GAL_INDEX,       index);     
1280GALPHOT_FIELD(GAL_CHISQ,       chisq);     
1281GALPHOT_FIELD(GAL_NPIX,        Npix);       
1282GALPHOT_FIELD(GAL_FLAGS,       flags);       
1283GALPHOT_FIELD(GAL_TYPE,        modelType);       
1284
1285# undef GALPHOT_FIELD
1286
1287# endif // DVO_H
Note: See TracBrowser for help on using the browser.