public software.sextractor

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

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