public software.sextractor

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