public software.sextractor

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

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

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