| 1 |
233 |
bertin |
/*
|
| 2 |
|
|
* field.h
|
| 3 |
2 |
bertin |
*
|
| 4 |
233 |
bertin |
* Include file for field.c.
|
| 5 |
2 |
bertin |
*
|
| 6 |
233 |
bertin |
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
| 7 |
2 |
bertin |
*
|
| 8 |
233 |
bertin |
* This file part of: SExtractor
|
| 9 |
2 |
bertin |
*
|
| 10 |
279 |
bertin |
* Copyright: (C) 1993-2012 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 |
279 |
bertin |
* Last modified: 08/02/2012
|
| 26 |
233 |
bertin |
*
|
| 27 |
|
|
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
| 28 |
2 |
bertin |
|
| 29 |
276 |
bertin |
#ifndef _FIELD_H_
|
| 30 |
|
|
#define _FIELD_H_
|
| 31 |
|
|
|
| 32 |
2 |
bertin |
/*------------------------------ field flags -------------------------------*/
|
| 33 |
|
|
#define DETECT_FIELD 0x01 /* Detection */
|
| 34 |
|
|
#define MEASURE_FIELD 0x02 /* Measurement */
|
| 35 |
|
|
#define FLAG_FIELD 0x04 /* Flagging */
|
| 36 |
|
|
#define RMS_FIELD 0x08 /* Weighting with std deviations */
|
| 37 |
|
|
#define VAR_FIELD 0x10 /* Weighting with variances */
|
| 38 |
|
|
#define WEIGHT_FIELD 0x20 /* Weighting with weights */
|
| 39 |
|
|
#define BACKRMS_FIELD 0x40 /* Weighting from a backrms matrix */
|
| 40 |
|
|
#define INTERP_FIELD 0x80 /* Purely interpolated data */
|
| 41 |
|
|
|
| 42 |
|
|
|
| 43 |
276 |
bertin |
/*------------------------------- structures --------------------------------*/
|
| 44 |
|
|
/* image parameters */
|
| 45 |
|
|
typedef struct field
|
| 46 |
|
|
{
|
| 47 |
|
|
struct field *reffield; /* pointer to a reference field */
|
| 48 |
|
|
char filename[MAXCHAR]; /* pointer to the image filename */
|
| 49 |
|
|
char *rfilename; /* pointer to the reduced image name */
|
| 50 |
|
|
char hfilename[MAXCHAR]; /* external header filename */
|
| 51 |
|
|
int headflag; /* external header found? */
|
| 52 |
|
|
char ident[MAXCHAR]; /* field identifier (read from FITS)*/
|
| 53 |
|
|
char rident[MAXCHAR]; /* field identifier (relative) */
|
| 54 |
|
|
catstruct *cat; /* FITS structure */
|
| 55 |
|
|
tabstruct *tab; /* FITS extension structure */
|
| 56 |
|
|
int bitpix; /* FITS image bitpix (for metadata) */
|
| 57 |
|
|
/* ---- main image parameters */
|
| 58 |
|
|
int width, height; /* x,y size of the field */
|
| 59 |
|
|
KINGSIZE_T npix; /* total number of pixels */
|
| 60 |
|
|
double ngamma; /* normalized photo gamma */
|
| 61 |
|
|
int nlevels; /* nb of quantification levels */
|
| 62 |
|
|
float pixmin, pixmax; /* min and max values in frame */
|
| 63 |
|
|
int y; /* y current position in field */
|
| 64 |
|
|
int ymin; /* y limit (lowest accessible) */
|
| 65 |
|
|
int ymax; /* y limit (highest accessible+1) */
|
| 66 |
|
|
int yblank; /* y blanking limit (highest+1) */
|
| 67 |
|
|
PIXTYPE *strip; /* pointer to the image buffer */
|
| 68 |
|
|
FLAGTYPE *fstrip; /* pointer to the FLAG buffer */
|
| 69 |
|
|
int stripheight; /* height of a strip (in lines) */
|
| 70 |
|
|
int stripmargin; /* number of lines in margin */
|
| 71 |
|
|
int stripstep; /* number of lines at each read */
|
| 72 |
|
|
int stripy; /* y position in buffer */
|
| 73 |
|
|
int stripylim; /* y limit in buffer */
|
| 74 |
|
|
int stripysclim; /* y scroll limit in buffer */
|
| 75 |
279 |
bertin |
/* ---- astrometric parameters */
|
| 76 |
|
|
struct wcs *wcs; /* astrometric data */
|
| 77 |
|
|
struct structassoc *assoc; /* ptr to the assoc-list */
|
| 78 |
|
|
int flags; /* flags defining the field type */
|
| 79 |
|
|
double pixscale; /* pixel size in arcsec.pix-1 */
|
| 80 |
|
|
double epoch; /* epoch of coordinates */
|
| 81 |
|
|
/* ---- photometric parameters */
|
| 82 |
|
|
int photomlabel; /* photometric label index */
|
| 83 |
|
|
double gain; /* conversion factor in e-/ADU */
|
| 84 |
|
|
double satur_level; /* saturation level in ADUs */
|
| 85 |
276 |
bertin |
/* ---- background parameters */
|
| 86 |
|
|
float *back; /* ptr to the background map in mem */
|
| 87 |
|
|
float *dback; /* ptr to the background deriv. map */
|
| 88 |
|
|
float *sigma; /* ptr to the sigma map */
|
| 89 |
|
|
float *dsigma; /* Ptr to the sigma deriv. map */
|
| 90 |
|
|
int backw, backh; /* x,y size of a bkgnd mesh */
|
| 91 |
|
|
int nbackp; /* total nb of pixels per bkgnd mesh */
|
| 92 |
|
|
int nbackx, nbacky; /* x,y number of bkgnd meshes */
|
| 93 |
|
|
int nback; /* total number of bkgnd meshes */
|
| 94 |
|
|
int nbackfx, nbackfy; /* x,y size of bkgnd filtering mask */
|
| 95 |
|
|
float backmean; /* median bkgnd value in image */
|
| 96 |
|
|
float backsig; /* median bkgnd rms in image */
|
| 97 |
|
|
float sigfac; /* scaling RMS factor (for WEIGHTs) */
|
| 98 |
|
|
PIXTYPE *backline; /* current interpolated bkgnd line */
|
| 99 |
|
|
PIXTYPE dthresh; /* detection threshold */
|
| 100 |
|
|
PIXTYPE thresh; /* analysis threshold */
|
| 101 |
|
|
backenum back_type; /* Background type */
|
| 102 |
|
|
/* ---- astrometric parameters */
|
| 103 |
|
|
/* ---- image interpolation */
|
| 104 |
|
|
int interp_flag; /* interpolation for this field? */
|
| 105 |
|
|
PIXTYPE *interp_backup; /* backup line for interpolation */
|
| 106 |
|
|
PIXTYPE weight_thresh; /* interpolation threshold */
|
| 107 |
|
|
int *interp_ytimeoutbuf; /* interpolation timeout line buffer */
|
| 108 |
|
|
int interp_xtimeout; /* interpolation timeout value in x */
|
| 109 |
|
|
int interp_ytimeout; /* interpolation timeout value in y */
|
| 110 |
|
|
/* ---- PSF */
|
| 111 |
|
|
struct psf *psf; /* image PSF model */
|
| 112 |
|
|
} fieldstruct;
|
| 113 |
|
|
|
| 114 |
|
|
|
| 115 |
|
|
/*------------------------------- functions ---------------------------------*/
|
| 116 |
|
|
|
| 117 |
|
|
void field_end(fieldstruct *field);
|
| 118 |
|
|
|
| 119 |
|
|
fieldstruct *field_inherit(fieldstruct *infield, int flags),
|
| 120 |
279 |
bertin |
*field_init(char *filename, int ext, int flags);
|
| 121 |
276 |
bertin |
|
| 122 |
|
|
#endif
|