public software.sextractor

[/] [branches/] [multi/] [src/] [prefs.h] - Blame information for rev 267

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

Line No. Rev Author Line
1 233 bertin
/*
2
*                               prefs.h
3 2 bertin
*
4 233 bertin
* Include file for prefs.c.
5 2 bertin
*
6 233 bertin
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7 2 bertin
*
8 233 bertin
*       This file part of:      SExtractor
9 2 bertin
*
10 245 bertin
*       Copyright:              (C) 1993-2011 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 267 bertin
*       Last modified:          06/10/2011
26 233 bertin
*
27
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
28 2 bertin
 
29 173 bertin
#ifndef _PROFIT_H_
30
#include        "profit.h"
31
#endif
32
 
33
#ifndef _PATTERN_H_
34
#include        "pattern.h"
35
#endif
36
 
37 2 bertin
#ifndef _PREFS_H_
38
#define _PREFS_H_
39
 
40
/*----------------------------- Internal constants --------------------------*/
41
 
42 252 bertin
#define MAXCHARL        16384           /* max. nb of chars in a string list */
43 267 bertin
#define MAXLIST         2048            /* max. nb of list members */
44 252 bertin
#define MAXLISTSIZE     2000000         /* max size of list */
45 2 bertin
 
46
/* NOTES:
47
One must have:  MAXLIST >= 1 (preferably >= 16!)
48
*/
49 267 bertin
 
50 2 bertin
/*------------------------------- preferences -------------------------------*/
51
typedef struct
52
  {
53 13 bertin
  char          **command_line;                         /* Command line */
54
  int           ncommand_line;                          /* nb of params */
55 2 bertin
  char          prefs_name[MAXCHAR];                    /* prefs filename*/
56
  char          *(image_name[2]);                       /* image filenames */
57
  int           nimage_name;                            /* nb of params */
58
  char          cat_name[MAXCHAR];                      /* catalog filename*/
59 220 bertin
  char          head_suffix[MAXCHAR];                   /* ext. header suffix */
60 253 bertin
/*----- catalog output */
61 267 bertin
  char          *(param[MAXLIST]);                      /* catalog parameters*/
62 253 bertin
  int           nparam;                                 /* nb of params */
63 2 bertin
/*----- thresholding */
64
  double        dthresh[2];                             /* detect. threshold */
65
  int           ndthresh;                               /* (1 or 2 entries) */
66
  double        thresh[2];                              /* analysis thresh. */
67
  int           nthresh;                                /* (1 or 2 entries) */
68
  enum  {THRESH_RELATIVE, THRESH_ABSOLUTE}
69
                                        thresh_type[2]; /* bkgnd type */
70
  int           nthresh_type;                           /* nb of params */
71
/*----- extraction */
72
  int           dimage_flag;                            /* detect. image ? */
73
  int           ext_minarea;                            /* min area in pix. */
74 219 bertin
  int           ext_maxarea;                            /* max area in pix. */
75 2 bertin
  int           deb_maxarea;                            /* max deblend. area */
76
  int           filter_flag;                            /* smoothing on/off */
77
  char          filter_name[MAXCHAR];                   /* mask filename */
78
  double        filter_thresh[2];                       /* Filter thresholds */
79
  int           nfilter_thresh;                         /* nb of params */
80
  int           deblend_nthresh;                        /* threshold number */
81
  double        deblend_mincont;                        /* minimum contrast */
82 173 bertin
  char          satur_key[8];                           /* saturation keyword */
83 2 bertin
  double        satur_level;                            /* saturation level */
84
  enum  {CCD, PHOTO}                    detect_type;    /* detection type */
85
/*----- Flagging */
86
  char          *(fimage_name[MAXFLAG]);                /* flagmap filenames */
87
  int           nfimage_name;                           /* nb of params */
88
  enum  {FLAG_OR, FLAG_AND, FLAG_MIN, FLAG_MAX, FLAG_MOST}
89
                                flag_type[MAXFLAG];     /* flag combination */
90
  int           imaflag_size;                           /* requested iso nb1 */
91
  int           imanflag_size;                          /* requested iso nb2 */
92
  int           nimaisoflag;                            /* effective iso nb */
93
  int           nimaflag;                               /* effective ima nb */
94
/*----- cleaning */
95
  int           clean_flag;                             /* allow cleaning ? */
96
  double        clean_param;                            /* cleaning effic. */
97
/*----- Weighting */
98
  char          *(wimage_name[2]);                      /* weight filenames */
99
  int           nwimage_name;                           /* nb of params */
100
  weightenum    weight_type[2];                         /* weighting scheme */
101
  int           nweight_type;                           /* nb of params */
102
  int           weight_flag;                            /* do we weight ? */
103
  int           dweight_flag;                           /* detection weight? */
104
  int           weightgain_flag;                        /* weight gain? */
105 245 bertin
  int           wscale_flag[2];         /* Weight rescaling */
106
  int           nwscale_flag;                           /* nb of params */
107 2 bertin
/*----- photometry */
108 11 bertin
  enum  {CAT_NONE, ASCII, ASCII_HEAD, ASCII_SKYCAT, ASCII_VO,
109 2 bertin
        FITS_LDAC, FITS_TPX, FITS_10}
110
                cat_type;                               /* type of catalog */
111
  enum  {PNONE, FIXED, AUTO}            apert_type;     /* type of aperture */
112
  double        apert[MAXNAPER];                        /* apert size (pix) */
113
  int           naper;                                  /* effective apert. */
114
  int           flux_apersize, fluxerr_apersize;        /* requested apert. */
115
  int           mag_apersize, magerr_apersize;          /* requested apert. */
116
  double        autoparam[2];                           /* Kron parameters */
117
  int           nautoparam;                             /* nb of Kron params */
118
  double        petroparam[2];                          /* Kron parameters */
119
  int           npetroparam;                            /* nb of Kron params */
120
  double        autoaper[2];                            /* minimum apertures */
121
  int           nautoaper;                              /* nb of min. aperts */
122
  double        mag_zeropoint;                          /* magnitude offsets */
123
  double        mag_gamma;                              /* for emulsions */
124
  double        gain;                                   /* only for CCD */
125 173 bertin
  char          gain_key[8];                            /* gain keyword */
126 2 bertin
/*----- S/G separation */
127
  double        pixel_scale;                            /* in arcsec */
128
  double        seeing_fwhm;                            /* in arcsec */
129
  char          nnw_name[MAXCHAR];                      /* nnw filename */
130
/*----- background */
131
  enum  {IMAGE, AFILE}                  back_origin;    /* origin of bkgnd */
132
  char          back_name[MAXCHAR];                     /* bkgnd filename */
133
  backenum      back_type[2];                           /* bkgnd type */
134
  int           nback_type;                             /* nb of params */
135
  double        back_val[2];                            /* user-def. bkg */
136
  int           nback_val;                              /* nb of params */
137
  int           backsize[2];                            /* bkgnd mesh size */
138
  int           nbacksize;                              /* nb of params */
139
  int           backfsize[2];                           /* bkgnd filt. size */
140
  int           nbackfsize;                             /* nb of params */
141
  double        backfthresh;                            /* bkgnd fil. thresh */
142
  enum  {GLOBAL, LOCAL}                 pback_type;     /* phot. bkgnd type */
143
  int           pback_size;                             /* rect. ann. width */
144
/*----- memory */
145 267 bertin
  int           clean_stacksize;                        /* obj buffer size*/
146
  int           obj2_stacksize;                         /* obj2 buffer size*/
147 2 bertin
  int           mem_pixstack;                           /* pixel stack size */
148
  int           mem_bufsize;                            /* strip height */
149
/*----- miscellaneous */
150
  int           pipe_flag;                              /* allow piping ? */
151
  enum  {QUIET, NORM, WARN, FULL}       verbose_type;   /* display type */
152 8 bertin
  int           xml_flag;                               /* Write XML file? */
153
  char          xml_name[MAXCHAR];                      /* XML file name */
154
  char          xsl_name[MAXCHAR];                      /* XSL file name (or URL) */
155
  char          sdate_start[12];                        /* SCAMP start date */
156
  char          stime_start[12];                        /* SCAMP start time */
157
  char          sdate_end[12];                          /* SCAMP end date */
158
  char          stime_end[12];                          /* SCAMP end time */
159 9 bertin
  double        time_diff;                              /* Execution time */
160 2 bertin
/*----- CHECK-images */
161
  int           check_flag;                             /* CHECK-image flag */
162
  checkenum     check_type[MAXCHECK];                   /* check-image types */
163
  int           ncheck_type;                            /* nb of params */
164
  char          *(check_name[MAXCHECK]);                /* check-image names */
165
  int           ncheck_name;                            /* nb of params */
166
  struct structcheck    *(check[MAXCHECK]);             /* check-image ptrs */
167
/*----- ASSOCiation */
168
  int           assoc_flag;                             /* ASSOCiation flag */
169
  char          assoc_name[MAXCHAR];                    /* ASSOC-list name */
170
  int           assoc_param[3];                         /* ASSOC param cols */
171
  int           nassoc_param;                           /* nb of params */
172
  int           assoc_data[MAXNASSOC];                  /* ASSOC data cols */
173
  int           nassoc_data;                            /* nb of params */
174
  enum  {ASSOC_FIRST, ASSOC_NEAREST, ASSOC_MEAN, ASSOC_MAGMEAN,
175
         ASSOC_SUM, ASSOC_MAGSUM, ASSOC_MIN, ASSOC_MAX}
176
                assoc_type;                             /* type of assoc. */
177 245 bertin
  enum  {ASSOCCOORD_PIXEL, ASSOCCOORD_WORLD}
178
                assoccoord_type;                        /* type of coords */
179 2 bertin
  enum  {ASSOCSELEC_ALL, ASSOCSELEC_MATCHED, ASSOCSELEC_NOMATCHED}
180
                assocselec_type;                        /* type of assoc. */
181
  double        assoc_radius;                           /* ASSOC range */
182
  int           assoc_size;                             /* nb of parameters */
183
  char          retina_name[MAXCHAR];                   /* retina filename */
184
  int           vignetsize[2];                          /* vignet size */
185
  int           vigshiftsize[2];                        /* shift-vignet size */
186
  int           cleanmargin;                            /* CLEANing margin */
187
  char          som_name[MAXCHAR];                      /* SOM filename */
188
  int           somfit_flag;                            /* ASSOCiation flag */
189
  int           somfit_vectorsize;                      /* SOMfit vec. size */
190
/*----- masking */
191
  enum {MASK_NONE, MASK_BLANK, MASK_CORRECT}
192
                mask_type;                              /* type of masking */
193
  int           blank_flag;                             /* BLANKing flag */
194
  double        weight_thresh[2];                       /* weight threshlds */
195
  int           nweight_thresh;                         /* nb of params */
196
/*----- interpolation */
197
  enum  {INTERP_NONE, INTERP_VARONLY, INTERP_ALL}
198
                interp_type[2];                         /* interpolat. type */
199
  int           ninterp_type;                           /* nb of params */
200
  int           interp_xtimeout[2];                     /* interp. x timeout */
201
  int           ninterp_xtimeout;                       /* nb of params */
202
  int           interp_ytimeout[2];                     /* interp. y timeout */
203
  int           ninterp_ytimeout;                       /* nb of params */
204
/*----- astrometry */
205
  int           world_flag;                             /* WORLD required */
206 16 bertin
  char          coosys[16];                             /* VOTable coord.sys */
207
  double        epoch;                                  /* VOTable epoch */
208 2 bertin
/*----- growth curve */
209
  int           growth_flag;                            /* gr. curve needed */
210
  int           flux_growthsize;                        /* number of elem. */
211
  int           mag_growthsize;                         /* number of elem. */
212
  int           flux_radiussize;                        /* number of elem. */
213
  double        growth_step;                            /* step size (pix) */
214
  double        flux_frac[MAXNAPER];                    /* for FLUX_RADIUS */
215
  int           nflux_frac;                             /* number of elem. */
216
/*----- PSF-fitting */
217 234 bertin
  int           psf_flag;                               /* PSF needed */
218
  int           dpsf_flag;                              /* detectiob PSF */
219
  int           psffit_flag;                            /* PSF-fit needed */
220
  int           dpsffit_flag;                           /* dual image PSF-fit */
221 5 bertin
  char          *(psf_name[2]);                         /* PSF filename */
222
  int           npsf_name;                              /* nb of params */
223 2 bertin
  int           psf_npsfmax;                            /* Max # of PSFs */
224
  int           psf_xsize,psf_ysize;                    /* nb of params */
225
  int           psf_xwsize,psf_ywsize;                  /* nb of params */
226
  int           psf_alphassize,psf_deltassize;          /* nb of params */
227
  int           psf_alpha2000size,psf_delta2000size;    /* nb of params */
228
  int           psf_alpha1950size,psf_delta1950size;    /* nb of params */
229
  int           psf_fluxsize;                           /* nb of params */
230
  int           psf_fluxerrsize;                        /* nb of params */
231
  int           psf_magsize;                            /* nb of params */
232
  int           psf_magerrsize;                         /* nb of params */
233 173 bertin
  int           prof_flag;                              /* Profile-fitting */
234
  int           pattern_flag;                           /* Pattern-fitting */
235
/*----- Profile-fitting */
236 258 bertin
  int           prof_modelflags;                        /* model flags */
237 173 bertin
  int           prof_vectorsize;                        /* nb of params */
238
  int           prof_errvectorsize;                     /* nb of params */
239 208 bertin
  int           prof_errmatrixsize[2];                  /* nb of params */
240 173 bertin
  int           prof_disk_patternvectorsize;            /* nb of params */
241
  int           prof_disk_patternncomp;                 /* nb of params */
242
  int           prof_disk_patternmodvectorsize;         /* nb of params */
243
  int           prof_disk_patternmodncomp;              /* nb of params */
244
  int           prof_disk_patternargvectorsize;         /* nb of params */
245
  int           prof_disk_patternargncomp;              /* nb of params */
246
/*----- Pattern-fitting */
247
  pattypenum    pattern_type;                           /* Disk pattern type */
248 2 bertin
/*----- customize */
249
  int           fitsunsigned_flag;                      /* Force unsign FITS */
250
  int           next;                        /* Number of extensions in file */
251 8 bertin
/* Multithreading */
252
  int           nthreads;                       /* Number of active threads */
253 2 bertin
  }     prefstruct;
254
 
255 253 bertin
prefstruct      prefs;
256 2 bertin
 
257
/*-------------------------------- protos -----------------------------------*/
258 252 bertin
extern char     *list_to_str(char *listname);
259
 
260 2 bertin
extern int      cistrcmp(char *cs, char *ct, int mode);
261
 
262
extern void     dumpprefs(int state),
263 173 bertin
                endprefs(void),
264
                preprefs(void),
265 2 bertin
                readprefs(char *filename,char **argkey,char **argval,int narg),
266
                useprefs(void);
267
#endif