public software.sextractor

[/] [trunk/] [src/] [types.h] - Blame information for rev 173

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 bertin
 /*
2
                                types.h
3
 
4
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5
*
6
*       Part of:        SExtractor
7
*
8
*       Author:         E.BERTIN (IAP)
9
*
10
*       Contents:       global type definitions.
11
*
12 173 bertin
*       Last modify:    25/09/2008
13 2 bertin
*
14
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15
*/
16
 
17
#include <stdio.h>
18
 
19
#ifndef _FITSCAT_H_
20
#include "fits/fitscat.h"
21
#endif
22 173 bertin
#ifndef _FITSWCS_H_
23
#include "fitswcs.h"
24
#endif
25 2 bertin
 
26
/*-------------------------------- flags ------------------------------------*/
27
 
28
#define         OBJ_CROWDED     0x0001
29
#define         OBJ_MERGED      0x0002
30
#define         OBJ_SATUR       0x0004
31
#define         OBJ_TRUNC       0x0008
32
#define         OBJ_APERT_PB    0x0010
33
#define         OBJ_ISO_PB      0x0020
34
#define         OBJ_DOVERFLOW   0x0040
35
#define         OBJ_OVERFLOW    0x0080
36
 
37 4 bertin
/*----------------------------- weight flags --------------------------------*/
38
 
39
#define         OBJ_WEIGHTZERO  0x0001
40
#define         OBJ_DWEIGHTZERO 0x0002
41
 
42 2 bertin
/*---------------------------- preanalyse flags -----------------------------*/
43
 
44
#define         ANALYSE_FAST            0
45
#define         ANALYSE_FULL            1
46
#define         ANALYSE_ROBUST          2
47
 
48
/*--------------------------------- typedefs --------------------------------*/
49
typedef unsigned char   BYTE;                   /* a byte */
50
typedef unsigned short  USHORT;                 /* 0 to 65535 integers */
51
typedef char            pliststruct;            /* Dummy type for plist */
52
 
53
typedef int             LONG;
54
typedef unsigned int    ULONG;
55
 
56
typedef  enum {BACK_RELATIVE, BACK_ABSOLUTE}
57
                backenum;                               /* BACK_TYPE */
58
 
59
typedef  enum {CHECK_NONE, CHECK_IDENTICAL, CHECK_BACKGROUND,
60
        CHECK_BACKRMS, CHECK_MINIBACKGROUND, CHECK_MINIBACKRMS,
61
        CHECK_SUBTRACTED, CHECK_FILTERED, CHECK_OBJECTS, CHECK_APERTURES,
62
        CHECK_SEGMENTATION, CHECK_ASSOC, CHECK_SUBOBJECTS,
63
        CHECK_SUBPSFPROTOS, CHECK_PSFPROTOS,
64
        CHECK_SUBPCPROTOS, CHECK_PCPROTOS, CHECK_PCOPROTOS,
65 173 bertin
        CHECK_MAPSOM, CHECK_SUBPROFILES, CHECK_PROFILES, CHECK_PATTERNS,
66
        MAXCHECK}
67
                checkenum;
68 2 bertin
        /* CHECK_IMAGE type */
69
 
70
typedef  enum {WEIGHT_NONE, WEIGHT_FROMBACK, WEIGHT_FROMRMSMAP,
71
                WEIGHT_FROMVARMAP, WEIGHT_FROMWEIGHTMAP, WEIGHT_FROMINTERP}
72
                weightenum;                             /* WEIGHT_IMAGE type */
73
 
74
/*--------------------------------- objects ---------------------------------*/
75
/* I: "PIXEL" parameters */
76
 
77
typedef struct
78
  {
79
/* ---- basic parameters */
80
  int           number;                         /* ID */
81
  int           fdnpix;                         /* nb of extracted pix */
82
  int           dnpix;                          /* nb of pix above thresh  */
83
  int           npix;                           /* "" in measured frame */
84
  float         fdflux;                         /* integrated ext. flux */
85
  float         dflux;                          /* integrated det. flux */
86
  float         flux;                           /* integrated mes. flux */
87
  float         fluxerr;                        /* integrated variance */
88
  PIXTYPE       fdpeak;                         /* peak intensity (ADU) */
89
  PIXTYPE       dpeak;                          /* peak intensity (ADU) */
90
  PIXTYPE       peak;                           /* peak intensity (ADU) */
91
/* ---- astrometric data */
92
  int           peakx,peaky;                    /* pos of brightest pix */
93
  double        mx, my;                         /* barycenter */
94
  double        poserr_mx2, poserr_my2,
95
                poserr_mxy;                     /* Error ellips moments */
96
/* ---- morphological data */
97
  int           xmin,xmax,ymin,ymax,ycmin,ycmax;/* x,y limits */
98
  PIXTYPE       *blank, *dblank;                /* BLANKing sub-images  */
99
  int           *submap;                        /* Pixel-index sub-map */
100
  int           subx,suby, subw,subh;           /* sub-image pos. and size */
101
  short         flag;                           /* extraction flags */
102 4 bertin
  BYTE          wflag;                          /* weighted extraction flags */
103 2 bertin
  FLAGTYPE      imaflag[MAXFLAG];               /* flags from FLAG-images */
104
  BYTE          singuflag;                      /* flags for singularities */
105
  int           imanflag[MAXFLAG];              /* number of MOST flags */
106
  double        mx2,my2,mxy;                    /* variances and covariance */
107
  float         a, b, theta, abcor;             /* moments and angle */
108
  float         cxx,cyy,cxy;                    /* ellipse parameters */
109
  int           firstpix;                       /* ptr to first pixel */
110
  int           lastpix;                        /* ptr to last pixel */
111
  float         bkg, dbkg, sigbkg;              /* Background stats (ADU) */
112
  float         thresh;                         /* measur. threshold (ADU) */
113
  float         dthresh;                        /* detect. threshold (ADU) */
114
  float         mthresh;                        /* max. threshold (ADU) */
115
  int           iso[NISO];                      /* isophotal areas */
116
  float         fwhm;                           /* IMAGE FWHM */
117
  }     objstruct;
118
 
119
/* II: "BLIND" parameters */
120
typedef struct
121
  {
122
/* ---- photometric data */
123
  float         flux_iso;                       /* ISO integrated flux */
124
  float         fluxerr_iso;                    /* RMS error on ISO flux */
125
  float         mag_iso;                        /* ISO mag */
126
  float         magerr_iso;                     /* ISO mag uncertainty */
127
  float         flux_isocor;                    /* ISOCOR integrated flux */
128
  float         fluxerr_isocor;                 /* RMS error on ISOCOR flux */
129
  float         mag_isocor;                     /* ISOCOR mag */
130
  float         magerr_isocor;                  /* ISOCOR mag uncertainty */
131
  float         kronfactor;                     /* kron parameter */
132
  float         flux_auto;                      /* AUTO integrated flux */
133
  float         fluxerr_auto;                   /* RMS error on AUTO flux */
134
  float         mag_auto;                       /* AUTO mag */
135
  float         magerr_auto;                    /* AUTO mag uncertainty */
136
  float         petrofactor;                    /* kron parameter */
137
  float         flux_petro;                     /* AUTO integrated flux */
138
  float         fluxerr_petro;                  /* RMS error on AUTO flux */
139
  float         mag_petro;                      /* AUTO mag */
140
  float         magerr_petro;                   /* AUTO mag uncertainty */
141
  float         flux_best;                      /* BEST integrated flux */
142
  float         fluxerr_best;                   /* RMS error on BEST flux */
143
  float         mag_best;                       /* BEST mag */
144
  float         magerr_best;                    /* BEST mag uncertainty */
145
  float         *flux_aper;                     /* APER flux vector */
146
  float         *fluxerr_aper;                  /* APER flux error vector  */
147
  float         *mag_aper;                      /* APER magnitude vector */
148
  float         *magerr_aper;                   /* APER mag error vector */
149
  float         flux_win;                       /* WINdowed flux*/
150
  float         fluxerr_win;                    /* WINdowed flux error */
151
  float         mag_win;                        /* WINdowed magnitude */
152
  float         magerr_win;                     /* WINdowed magnitude error */
153
/* ---- astrometric data */
154
  double        posx,posy;                      /* "FITS" pos. in pixels */
155 173 bertin
  double        jacob[NAXIS*NAXIS];             /* Local deproject. Jacobian */
156 2 bertin
  double        mamaposx,mamaposy;              /* "MAMA" pos. in pixels */
157
  float         sposx,sposy;                    /* single precision pos. */
158
  float         poserr_a, poserr_b,
159
                poserr_theta;                   /* Error ellips parameters */
160
  float         poserr_cxx, poserr_cyy,
161
                poserr_cxy;                     /* pos. error ellipse */
162
  double        poserr_mx2w, poserr_my2w,
163
                poserr_mxyw;                    /* WORLD error moments */
164
  float         poserr_aw, poserr_bw,
165
                poserr_thetaw;                  /* WORLD error parameters */
166
  float         poserr_thetas;                  /* native error pos. angle */
167
  float         poserr_theta2000;               /* J2000 error pos. angle */
168
  float         poserr_theta1950;               /* B1950 error pos. angle */
169
  float         poserr_cxxw, poserr_cyyw,
170
                poserr_cxyw;                    /* WORLD error ellipse */
171
  double        mx2w,my2w,mxyw;                 /* WORLD var. and covar. */
172
  double        peakxw, peakyw;                 /* WORLD of brightest pix */
173
  double        mxw, myw;                       /* WORLD barycenters */
174
  double        alphas, deltas;                 /* native alpha, delta */
175
  float         thetas;                         /* native position angle E/N*/
176
  double        peakalphas, peakdeltas;         /* native for brightest pix */
177
  double        peakalpha2000, peakdelta2000;   /* J2000 for brightest pix */
178
  double        peakalpha1950, peakdelta1950;   /* B1950 for brightest pix */
179
  double        alpha2000, delta2000;           /* J2000 alpha, delta */
180
  float         theta2000;                      /* J2000 position angle E/N */
181 173 bertin
  double        dtheta2000;                     /* North J2000 - native angle*/
182 2 bertin
  double        alpha1950, delta1950;           /* B1950 alpha, delta */
183
  float         theta1950;                      /* B1950 position angle E/N */
184 173 bertin
  double        dtheta1950;                     /* North B1950 - native angle*/
185 2 bertin
  float         aw, bw;                         /* WORLD ellipse size */
186
  float         thetaw;                         /* WORLD position angle */
187
  float         cxxw,cyyw,cxyw;                 /* WORLD ellipse parameters */
188
  float         npixw, fdnpixw;                 /* WORLD isophotal areas */
189
  float         threshmu;                       /* det. surface brightnees */
190
  float         maxmu;                          /* max. surface brightnees */
191
  float         elong;                          /* elongation */
192
  float         ellip;                          /* ellipticity */
193
  float         polar;                          /* Kaiser's "polarization" */
194
  float         polarw;                         /* WORLD "polarization" */
195
  float         sprob;                          /* Stellarity index */
196
  float         fwhmw;                          /* WORLD FWHM */
197
  float         *assoc;                         /* ASSOCiated data */
198
  int           assoc_number;                   /* nb of ASSOCiated objects */
199
  float         *vignet;                        /* Pixel data */
200
  float         *vigshift;                      /* (Shifted) pixel data */
201
 
202
/* Windowed measurements */
203
  double        winpos_x,winpos_y;              /* Windowed barycenter */
204
  double        winposerr_mx2, winposerr_my2,
205
                winposerr_mxy;                  /* Error ellips moments */
206
  float         winposerr_a, winposerr_b,
207
                winposerr_theta;                /* Error ellips parameters */
208
  float         winposerr_cxx, winposerr_cyy,
209
                winposerr_cxy;                  /* pos. error ellipse */
210
  double        winposerr_mx2w, winposerr_my2w,
211
                winposerr_mxyw;                 /* WORLD error moments */
212
  float         winposerr_aw, winposerr_bw,
213
                winposerr_thetaw;               /* WORLD error parameters */
214
  float         winposerr_thetas;               /* native error pos. angle */
215
  float         winposerr_theta2000;            /* J2000 error pos. angle */
216
  float         winposerr_theta1950;            /* B1950 error pos. angle */
217
  float         winposerr_cxxw, winposerr_cyyw,
218
                winposerr_cxyw;                 /* WORLD error ellipse */
219
  double        win_mx2, win_my2,
220
                win_mxy;                        /* Windowed moments */
221
  float         win_a, win_b,
222
                win_theta;                      /* Windowed ellipse parameters*/
223
  float         win_polar;                      /* Windowed "polarization" */
224
  float         win_cxx, win_cyy,
225
                win_cxy;                        /* Windowed ellipse parameters*/
226
  double        win_mx2w, win_my2w,
227
                win_mxyw;                       /* WORLD windowed moments */
228
  float         win_aw, win_bw,
229
                win_thetaw;                     /* WORLD ellipse parameters */
230
  float         win_polarw;                     /* WORLD WIN "polarization" */
231
  float         win_thetas;             /* native error pos. angle */
232
  float         win_theta2000;          /* J2000 error pos. angle */
233
  float         win_theta1950;          /* B1950 error pos. angle */
234
  float         win_cxxw, win_cyyw,
235
                win_cxyw;                       /* WORLD ellipse parameters */
236
  double        winpos_xw, winpos_yw;           /* WORLD coordinates */
237
  double        winpos_alphas, winpos_deltas;   /* native alpha, delta */
238
  double        winpos_alpha2000, winpos_delta2000;     /* J2000 alpha, delta */
239
  double        winpos_alpha1950, winpos_delta1950;     /* B1950 alpha, delta */
240
  short         winpos_niter;                   /* Number of WIN iterations */
241
  short         win_flag;                       /* 1:x2<0 2:xy=x2 4:flux<0 */
242
 
243
 /* ---- SOM fitting */
244
  float         flux_somfit;                    /* Fitted amplitude */
245
  float         fluxerr_somfit;                 /* RMS error on SOM flux */
246
  float         mag_somfit;                     /* Magnitude from SOM fit */
247
  float         magerr_somfit;                  /* Mag. err. from SOM fit */
248
  float         stderr_somfit;                  /* Fitting reduced error */
249
  float         *vector_somfit;                 /* SOM fit vector position */
250
/* ---- Growth curves and stuff */
251
  float         *flux_growth;                   /* Cumulated growth_curve */
252
  float         flux_growthstep;                /* Growth-curve step */
253
  float         *mag_growth;                    /* Cumulated growth_curve */
254
  float         mag_growthstep;                 /* Growth-curve step */
255
  float         *flux_radius;                   /* f-light-radii */
256
  float         hl_radius;                      /* Scalar half-light radius */
257
/* ---- PSF-fitting */
258
  float         *flux_psf;                      /* Flux from PSF-fitting */
259
  float         *fluxerr_psf;                   /* RMS error on PSF flux */
260
  float         *mag_psf;                       /* Mag from PSF-fitting */
261
  float         *magerr_psf;                    /* RMS mag from PSF-fitting */
262
  float         *x_psf, *y_psf;                 /* Coords from PSF-fitting */
263
  short         niter_psf;                      /* # of PSF-fitting iterat. */
264
  short         npsf;                           /* # of fitted PSFs */
265
  float         chi2_psf;                       /* Red. chi2 of PSF-fitting */
266
  double        xw_psf, yw_psf;                 /* WORLD coords */
267
  double        alphas_psf, deltas_psf;         /* native alpha, delta */
268
  double        alpha2000_psf, delta2000_psf;   /* J2000 alpha, delta */
269
  double        alpha1950_psf, delta1950_psf;   /* B1950 alpha, delta */
270
  double        poserrmx2_psf, poserrmy2_psf,
271
                poserrmxy_psf;                  /* Error ellips moments */
272
  float         poserra_psf, poserrb_psf,
273
                poserrtheta_psf;                /* Error ellips parameters */
274
  float         poserrcxx_psf, poserrcyy_psf,
275
                poserrcxy_psf;                  /* pos. error ellipse */
276
  double        poserrmx2w_psf, poserrmy2w_psf,
277
                poserrmxyw_psf;                 /* WORLD error moments */
278
  float         poserraw_psf, poserrbw_psf,
279
                poserrthetaw_psf;               /* WORLD error parameters */
280
  float         poserrthetas_psf;               /* native error pos. angle */
281
  float         poserrtheta2000_psf;            /* J2000 error pos. angle */
282
  float         poserrtheta1950_psf;            /* B1950 error pos. angle */
283
  float         poserrcxxw_psf, poserrcyyw_psf,
284
                poserrcxyw_psf;                 /* WORLD error ellipse */
285
/* ---- PC-fitting */
286
  double        mx2_pc,my2_pc,mxy_pc;           /* PC 2nd-order parameters */
287
  float         a_pc,b_pc,theta_pc;             /* PC shape parameters */
288
  float         *vector_pc;                     /* Principal components */
289
  float         gdposang;                       /* Gal. disk position angle */
290
  float         gdscale;                        /* Gal. disk scalelength */
291
  float         gdaspect;                       /* Gal. disk aspect-ratio */
292
  float         gde1,gde2;                      /* Gal. disk ellipticities */
293
  float         gbratio;                        /* Galaxy B/T */
294
  float         gbposang;                       /* Gal. bulge position angle */
295
  float         gbscale;                        /* Gal. bulge scalelength */
296
  float         gbaspect;                       /* Gal. bulge aspect-ratio */
297
  float         gbe1,gbe2;                      /* Gal. bulge ellipticities */
298
  float         flux_galfit;                    /* Galaxy tot. flux from fit */
299
  float         fluxerr_galfit;                 /* RMS error on galfit flux */
300
  float         mag_galfit;                     /* Galaxy tot. mag from fit */
301
  float         magerr_galfit;                  /* RMS error on galfit mag */
302 173 bertin
/* ---- Profile-fitting */
303
  float         *prof_vector;                   /* Profile parameters */
304
  float         *prof_errvector;                /* Profile parameter errors */
305
  float         prof_chi2;                      /* Reduced chi2 */
306
  BYTE          prof_flag;                      /* Model-fitting flags */
307
  BYTE          prof_flagw;                     /* Model-fitting WORLD flag */
308
  short         prof_niter;                     /* # of model-fitting iter. */
309
  float         flux_prof;                      /* Flux from model-fitting */
310
  float         fluxerr_prof;                   /* RMS error on model flux */
311
  float         mag_prof;                       /* Mag from model-fitting */
312
  float         magerr_prof;                    /* RMS mag from model-fitting */
313
  float         x_prof, y_prof;                 /* Coords from model-fitting*/
314
  double        xw_prof, yw_prof;               /* WORLD coords */
315
  double        alphas_prof, deltas_prof;       /* native alpha, delta */
316
  double        alpha2000_prof, delta2000_prof; /* J2000 alpha, delta */
317
  double        alpha1950_prof, delta1950_prof; /* B1950 alpha, delta */
318
  double        poserrmx2_prof, poserrmy2_prof,
319
                poserrmxy_prof;                 /* Error ellips moments */
320
  float         poserra_prof, poserrb_prof,
321
                poserrtheta_prof;               /* Error ellips parameters */
322
  float         poserrcxx_prof, poserrcyy_prof,
323
                poserrcxy_prof;                 /* pos. error ellipse */
324
  double        poserrmx2w_prof, poserrmy2w_prof,
325
                poserrmxyw_prof;                /* WORLD error moments */
326
  float         poserraw_prof, poserrbw_prof,
327
                poserrthetaw_prof;              /* WORLD error parameters */
328
  float         poserrthetas_prof;              /* native error pos. angle */
329
  float         poserrtheta2000_prof;           /* J2000 error pos. angle */
330
  float         poserrtheta1950_prof;           /* B1950 error pos. angle */
331
  float         poserrcxxw_prof, poserrcyyw_prof,
332
                poserrcxyw_prof;                /* WORLD error ellipse */
333
  double        prof_mx2, prof_my2, prof_mxy;   /* Profile model moments */
334
  double        prof_mx2w, prof_my2w, prof_mxyw;/* WORLD profile model moments*/
335
  float         prof_eps1, prof_eps2;           /* Profile model ellip.vector */
336
  float         prof_e1, prof_e2;               /* Profile model ellip.vector */
337
  float         prof_offset_flux;               /* Background offset */
338
  float         prof_offset_fluxerr;            /* RMS error */
339
  float         prof_spheroid_flux;             /* Spheroid total flux */
340
  float         prof_spheroid_fluxerr;          /* RMS error */
341
  float         prof_spheroid_mag;              /* Spheroid "total" mag */
342
  float         prof_spheroid_magerr;           /* RMS error */
343
  float         prof_spheroid_reff;             /* Spheroid effective radius */
344
  float         prof_spheroid_refferr;          /* RMS error */
345
  float         prof_spheroid_reffw;            /* WORLD spheroid eff. radius */
346
  float         prof_spheroid_refferrw;         /* RMS error */
347
  float         prof_spheroid_aspect;           /* Spheroid aspect ratio */
348
  float         prof_spheroid_aspecterr;        /* RMS error */
349
  float         prof_spheroid_aspectw;          /* WORLD spheroid aspect ratio*/
350
  float         prof_spheroid_aspecterrw;       /* RMS error */
351
  float         prof_spheroid_theta;            /* Spheroid position angle */
352
  float         prof_spheroid_thetaerr;         /* RMS error */
353
  float         prof_spheroid_thetaw;           /* WORLD spheroid pos. angle */
354
  float         prof_spheroid_thetaerrw;        /* RMS error */
355
  float         prof_spheroid_thetas;           /* Sky spheroid pos. angle */
356
  float         prof_spheroid_theta2000;        /* J2000 spheroid pos. angle */
357
  float         prof_spheroid_theta1950;        /* B1950 spheroid pos. angle */
358
  float         prof_spheroid_sersicn;          /* Spheroid Sersic index */
359
  float         prof_spheroid_sersicnerr;       /* RMS error */
360
  float         prof_disk_flux;                 /* Disk total flux */
361
  float         prof_disk_fluxerr;              /* RMS error */
362
  float         prof_disk_mag;                  /* Disk "total" mag */
363
  float         prof_disk_magerr;               /* RMS error */
364
  float         prof_disk_scale;                /* Disk scale length */
365
  float         prof_disk_scaleerr;             /* RMS error */
366
  float         prof_disk_scalew;               /* WORLD disk scale length */
367
  float         prof_disk_scaleerrw;            /* RMS error */
368
  float         prof_disk_aspect;               /* Disk aspect ratio */
369
  float         prof_disk_aspecterr;            /* RMS error */
370
  float         prof_disk_aspectw;              /* WORLD disk aspect ratio */
371
  float         prof_disk_aspecterrw;           /* RMS error */
372
  float         prof_disk_inclination;          /* Disk inclination */
373
  float         prof_disk_inclinationerr;       /* RMS error */
374
  float         prof_disk_theta;                /* Disk position angle */
375
  float         prof_disk_thetaerr;             /* RMS error */
376
  float         prof_disk_thetaw;               /* WORLD disk position angle */
377
  float         prof_disk_thetaerrw;            /* RMS error */
378
  float         prof_disk_thetas;               /* Sky disk position angle */
379
  float         prof_disk_theta2000;            /* J2000 disk position angle */
380
  float         prof_disk_theta1950;            /* B1950 disk position angle */
381
  float         *prof_disk_patternvector;       /* Disk pattern coefficients */
382
  float         *prof_disk_patternmodvector;    /* Disk pattern moduli */
383
  float         *prof_disk_patternargvector;    /* Disk pattern arguments */
384
  float         prof_disk_patternspiral;        /* Disk pattern spiral index */
385
  float         prof_bar_flux;                  /* Galactic bar total flux */
386
  float         prof_bar_fluxerr;               /* RMS error */
387
  float         prof_bar_mag;                   /* Bar "total" magnitude */
388
  float         prof_bar_magerr;                /* RMS error */
389
  float         prof_bar_length;                /* Bar length */
390
  float         prof_bar_lengtherr;             /* RMS error */
391
  float         prof_bar_lengthw;               /* WORLD bar length */
392
  float         prof_bar_lengtherrw;            /* RMS error */
393
  float         prof_bar_aspect;                /* Bar aspect ratio */
394
  float         prof_bar_aspecterr;             /* RMS error */
395
  float         prof_bar_aspectw;               /* WORLD bar aspect ratio */
396
  float         prof_bar_aspecterrw;            /* RMS error */
397
  float         prof_bar_posang;                /* Bar true prosition angle */
398
  float         prof_bar_posangerr;             /* RMS error */
399
  float         prof_bar_theta;                 /* Bar projected angle */
400
  float         prof_bar_thetaerr;              /* RMS error */
401
  float         prof_bar_thetaw;                /* WORLD bar projected angle */
402
  float         prof_bar_thetaerrw;             /* RMS error */
403
  float         prof_bar_thetas;                /* Sky bar projected angle */
404
  float         prof_bar_theta2000;             /* J2000 bar projected angle */
405
  float         prof_bar_theta1950;             /* B1950 bar projected angle */
406
  float         prof_arms_flux;                 /* Spiral arms total flux */
407
  float         prof_arms_fluxerr;              /* RMS error */
408
  float         prof_arms_mag;                  /* Arms "total" magnitude */
409
  float         prof_arms_magerr;               /* RMS error */
410
  float         prof_arms_scale;                /* Arms scalelength */
411
  float         prof_arms_scaleerr;             /* RMS error */
412
  float         prof_arms_scalew;               /* WORLD arms scalelength */
413
  float         prof_arms_scaleerrw;            /* RMS error */
414
  float         prof_arms_posang;               /* Arms true position angle */
415
  float         prof_arms_posangerr;            /* RMS error */
416
//  float               prof_arms_thetaw;               /* WORLD arms position angle */
417
//  float               prof_arms_thetas;               /* Sky arms position angle */
418
//  float               prof_arms_theta2000;            /* J2000 arms position angle */
419
//  float               prof_arms_theta1950;            /* B1950 arms position angle */
420
  float         prof_arms_pitch;                /* Arms pitch angle */
421
  float         prof_arms_pitcherr;             /* RMS error */
422
  float         prof_arms_start;                /* Arms starting radius */
423
  float         prof_arms_starterr;             /* RMS error */
424
  float         prof_arms_startw;               /* WORLD arms starting radius */
425
  float         prof_arms_starterrw;            /* RMS error */
426
  float         prof_arms_quadfrac;             /* Arms quadrature fraction */
427
  float         prof_arms_quadfracerr;          /* RMS error */
428 2 bertin
/* ---- MEF */
429
  short         ext_number;                     /* FITS extension number */
430
  }     obj2struct;
431
 
432
/*----------------------------- lists of objects ----------------------------*/
433
typedef struct
434
  {
435
  int           nobj;                   /* number of objects in list */
436
  objstruct     *obj;                   /* pointer to the object array */
437
  int           npix;                   /* number of pixels in pixel-list */
438
  pliststruct   *plist;                 /* pointer to the pixel-list */
439
  PIXTYPE       dthresh;                /* detection threshold */
440
  PIXTYPE       thresh;                 /* analysis threshold */
441
  }     objliststruct;
442
 
443
 
444
/*----------------------------- image parameters ----------------------------*/
445
typedef struct pic
446
  {
447
  char          filename[MAXCHAR];      /* pointer to the image filename */
448
  char          *rfilename;             /* pointer to the reduced image name */
449
  char          ident[MAXCHAR];         /* field identifier (read from FITS)*/
450
  char          rident[MAXCHAR];        /* field identifier (relative) */
451 173 bertin
  catstruct     *cat;                   /* FITS structure */
452
  tabstruct     *tab;                   /* FITS extension structure */
453 2 bertin
  FILE          *file;                  /* pointer the image file structure */
454
/* ---- main image parameters */
455
  int           bitpix, bytepix;        /* nb of bits and bytes per pixel */
456
  int           bitsgn;                 /* non-zero if signed integer data */
457
  int           width, height;          /* x,y size of the field */
458
  KINGSIZE_T    npix;                   /* total number of pixels */
459
  double        bscale, bzero;          /* FITS scale and offset */
460
  double        ngamma;                 /* normalized photo gamma */
461
  int           nlevels;                /* nb of quantification levels */
462
  float         pixmin, pixmax;         /* min and max values in frame */
463
  int           y;                      /* y current position in field */
464
  int           ymin;                   /* y limit (lowest accessible) */
465
  int           ymax;                   /* y limit (highest accessible+1) */
466
  int           yblank;                 /* y blanking limit (highest+1) */
467
  PIXTYPE       *strip;                 /* pointer to the image buffer */
468
  FLAGTYPE      *fstrip;                /* pointer to the FLAG buffer */
469
  int           stripheight;            /* height  of a strip (in lines) */
470
  int           stripmargin;            /* number of lines in margin */
471
  int           stripstep;              /* number of lines at each read */
472
  int           stripy;                 /* y position in buffer */
473
  int           stripylim;              /* y limit in buffer */
474
  int           stripysclim;            /* y scroll limit in buffer */
475
/* ---- basic astrometric parameters */
476
   double       pixscale;               /* pixel size in arcsec.pix-1 */
477
   double       epoch;                  /* epoch of coordinates */
478 173 bertin
/* ---- basic photometric parameters */
479
   double       gain;                   /* conversion factor in e-/ADU */
480
   double       satur_level;            /* saturation level in ADUs */
481 2 bertin
/* ---- background parameters */
482
  float         *back;                  /* ptr to the background map in mem */
483
  float         *dback;                 /* ptr to the background deriv. map */
484
  float         *sigma;                 /* ptr to the sigma map */
485
  float         *dsigma;                /* Ptr to the sigma deriv. map */
486
  int           backw, backh;           /* x,y size of a bkgnd mesh */
487
  int           nbackp;                 /* total nb of pixels per bkgnd mesh */
488
  int           nbackx, nbacky;         /* x,y number of bkgnd meshes */
489
  int           nback;                  /* total number of bkgnd meshes */
490
  int           nbackfx, nbackfy;       /* x,y size of bkgnd filtering mask */
491
  float         backmean;               /* median bkgnd value in image */
492
  float         backsig;                /* median bkgnd rms in image */
493
  float         sigfac;                 /* scaling RMS factor (for WEIGHTs) */
494
  PIXTYPE       *backline;              /* current interpolated bkgnd line */
495
  PIXTYPE       dthresh;                /* detection threshold */
496
  PIXTYPE       thresh;                 /* analysis threshold */
497
  backenum      back_type;              /* Background type */
498
/* ---- astrometric parameters */
499 173 bertin
  struct wcs    *wcs;                   /* astrometric data */
500 2 bertin
  struct structassoc    *assoc;         /* ptr to the assoc-list */
501
  int           flags;                  /* flags defining the field type */
502
/* ---- image interpolation */
503
  int           interp_flag;            /* interpolation for this field? */
504
  PIXTYPE       *interp_backup;         /* backup line for interpolation */
505
  PIXTYPE       weight_thresh;          /* interpolation threshold */
506
  int           *interp_ytimeoutbuf;    /* interpolation timeout line buffer */
507
  int           interp_xtimeout;        /* interpolation timeout value in x */
508
  int           interp_ytimeout;        /* interpolation timeout value in y */
509
  struct pic    *reffield;              /* pointer to a reference field */
510
  OFF_T         mefpos;                 /* Position in a MEF file */
511
  }     picstruct;
512
 
513
 
514
/*-------------------------------- catalog  ---------------------------------*/
515
 
516
typedef struct
517
  {
518
  int           ndetect;                                /* nb of detections */
519
  int           ntotal;                                 /* Total object nb */
520
  int           nparam;                                 /* Nb of parameters */
521
/*----- Misc. strings defining the extraction */
522
  char          prefs_name[MAXCHAR];                    /* Prefs filename*/
523
  char          image_name[MAXCHAR];                    /* image filename*/
524 5 bertin
  char          psf_name[MAXCHAR];                      /* PSF filename*/
525 2 bertin
  char          nnw_name[MAXCHAR];                      /* NNW name */
526
  char          filter_name[MAXCHAR];                   /* Filter name */
527
  char          soft_name[MAXCHAR];                     /* Sextractor version*/
528
/*----- time */
529
  char          ext_date[16],ext_time[16];              /* date and time */
530
  double        ext_elapsed;                            /* processing time */
531
/*----- MEF */
532
  int           currext;                                /* current extension */
533
  int           next;                                   /* Nb of extensions */
534
  }             sexcatstruct;
535