High-Level Data Reduction Library 1.6.0a5
High-Level data reduction routines for ESO pipelines
Loading...
Searching...
No Matches
hdrl_cat_def.h
Go to the documentation of this file.
1/*
2 * This file is part of the HDRL
3 * Copyright (C) 2017 European Southern Observatory
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#ifndef HDRL_CATALOGUE_DEF_H
21#define HDRL_CATALOGUE_DEF_H
22
23
24#include <cpl.h>
25#include <math.h>
26
27
28/*** DEFINES ***/
29
30/* must not be followed by a semicolon! gcc on mac has omp
31 * but it doesn't work for nontrivial cases as libc lacks allocate */
32#if defined (_OPENMP) && !defined( __APPLE__)
33#define HDRL_OMP(x) _Pragma (#x)
34#else
35#define HDRL_OMP(x)
36#endif
37
38/* Catalogue generation parameters */
39#define IMNUM 200 /* Maximum number of images to be deblended */
40#define NPAR 16 /* Number of parameters in a basic results array */
41#define NRADS 13 /* Number of RANDS (RADII) */
42#define NAREAL 8 /* Number of areals profiles */
43
44/* MFLAG values used for tracking the quality of individual pixels */
45#define MF_CLEANPIX 0 /* */
46#define MF_OBJPIX 1 /* */
47#define MF_SATURATED 2 /* */
48#define MF_ZEROCONF 3 /* */
49#define MF_STUPID_VALUE 4 /* */
50#define MF_POSSIBLEOBJ 5 /* */
51
52
53/*** DATA TYPES ***/
54
55typedef struct {
56 cpl_size x; /* */
57 cpl_size y; /* */
58 double z; /* */
59 double zsm; /* */
60 cpl_size iobj; /* */
61} plstruct;
62
63typedef struct {
64
65 cpl_size areal[NAREAL]; /* height above thresh of areal-prof cuts */
66
67 cpl_size lsiz; /* size of a line */
68 cpl_size csiz; /* size of a column */
69 cpl_size maxip; /* max no. of parents ever used. */
70 cpl_size maxbl; /* size of pixel-storage block stack */
71 cpl_size maxpa; /* size of parent-stack. */
72 cpl_size ipnop; /* parent-number-of-pixels, min size of image */
73 cpl_size nimages; /* count of images */
74 cpl_size ipstack; /* parent-name stack pointer */
75 cpl_size ibstack; /* pixel-block name stack pointer */
76 double thresh; /* threshold for image detection */
77 double background; /* background value */
78 double sigma; /* median background sigma */
79 cpl_size multiply; /* smoothing multiplication */
80 double xintmin; /* minimum intensity for consideration */
81 cpl_size mulpix; /* minimum size for considering multiple images */
82 double areal_offset; /* offset in areal profile levels */
83 double fconst; /* Normalisation constant for areal profiles */
84 double saturation; /* saturation level from background analysis */
85 cpl_size icrowd; /* true if deblending routine is to be used */
86
87 cpl_size *blink; /* block-link array */
88 cpl_size *bstack; /* stack of pixel names */
89
90 struct { /* Image control block array */
91 cpl_size first; /* link to first data block */
92 cpl_size last; /* current last block */
93 cpl_size pnop; /* Parent no. pixels (-1 = inactive) */
94 cpl_size growing;
95 cpl_size touch; /* 0 = does not touch an edge */
96 cpl_size pnbp; /* Parent no of bad pixels */
97 } *parent;
98
99 cpl_size *pstack; /* stack of parent names */
100 plstruct *plessey; /* x,y,i storage array */
101 cpl_size *lastline; /* Parents on last line */
102
103 cpl_image *inframe; /* Pointer to original image data frame */
104 cpl_image *conframe; /* Pointer to original confidence map frame */
105 double *indata; /* Pointer to original image data */
106 double *confdata; /* Pointer to original confidence map data */
107 unsigned char *mflag; /* Pointer to mflag array for tracking merges */
108 cpl_mask *opmask; /* Object pixel mask */
109 double rcore; /* Core radius for aperture photometry */
110 double filtfwhm; /* FWHM of smoothing kernel in detection algorithm */
111 plstruct *plarray; /* Plessey structure workspace for passing data to various processing routines */
112 cpl_size npl; /* Size of the above */
113 cpl_size npl_pix; /* Number of pixels in the above structure */
114 double fwhm; /* Value of the seeing */
115
116 struct {
117 cpl_size nbx; /* X dimension of background map */
118 cpl_size nby; /* Y dimension of background map */
119 cpl_size nbsize; /* Size of a side of background map cell */
120 double **bvals; /* Pointer to background map */
121 } backmap;
122} ap_t;
123
124typedef struct {
125 double x; /* x position */
126 double y; /* y position */
127 double total; /* total integrated intensity */
128 cpl_size area; /* image area in pixels */
129 double peak; /* peak image intensity above sky */
130 double xx; /* 2nd moment x */
131 double xy; /* 2nd moment cross term */
132 double yy; /* 2nd moment y */
133 double ecc; /* Eccentricity */
134 cpl_size areal[NAREAL]; /* areal profile of image */
135} apmCat_t;
136
137
138/* cpl_image functions */
139typedef struct {
140 cpl_image *image; /* */
141 cpl_propertylist *ehu; /* */
143
144/* cpl_table functions */
145typedef struct {
146 cpl_table *table; /* */
147 cpl_propertylist *ehu; /* */
149
150
151#define HDRL_SATURATION_INIT INFINITY
152
159
160/* Catalogue structure */
161typedef struct {
162 hdrl_casu_tfits *catalogue; /* cpl_table and property list */
163 cpl_image *segmentation_map; /* */
164 cpl_image *background; /* */
166
167
168#endif /* HDRL_CATALOGUE_DEF_H */
#define NAREAL
Definition hdrl_cat_def.h:42
hdrl_catalogue_options
Definition hdrl_cat_def.h:153
@ HDRL_CATALOGUE_ALL
Definition hdrl_cat_def.h:157
@ HDRL_CATALOGUE_CAT_COMPLETE
Definition hdrl_cat_def.h:156
@ HDRL_CATALOGUE_BKG
Definition hdrl_cat_def.h:154
@ HDRL_CATALOGUE_SEGMAP
Definition hdrl_cat_def.h:155
Definition hdrl_cat_def.h:55
cpl_size y
Definition hdrl_cat_def.h:57
cpl_size iobj
Definition hdrl_cat_def.h:60
double zsm
Definition hdrl_cat_def.h:59
cpl_size x
Definition hdrl_cat_def.h:56
double z
Definition hdrl_cat_def.h:58
Definition hdrl_cat_def.h:63
double * confdata
Definition hdrl_cat_def.h:106
cpl_size * pstack
Definition hdrl_cat_def.h:99
cpl_size * blink
Definition hdrl_cat_def.h:87
double * indata
Definition hdrl_cat_def.h:105
cpl_size nbsize
Definition hdrl_cat_def.h:119
cpl_size csiz
Definition hdrl_cat_def.h:68
cpl_size * lastline
Definition hdrl_cat_def.h:101
cpl_size mulpix
Definition hdrl_cat_def.h:81
cpl_size npl
Definition hdrl_cat_def.h:112
unsigned char * mflag
Definition hdrl_cat_def.h:107
double xintmin
Definition hdrl_cat_def.h:80
double background
Definition hdrl_cat_def.h:77
plstruct * plessey
Definition hdrl_cat_def.h:100
cpl_mask * opmask
Definition hdrl_cat_def.h:108
cpl_size * bstack
Definition hdrl_cat_def.h:88
double ** bvals
Definition hdrl_cat_def.h:120
cpl_image * conframe
Definition hdrl_cat_def.h:104
cpl_size maxpa
Definition hdrl_cat_def.h:71
cpl_size last
Definition hdrl_cat_def.h:92
double fwhm
Definition hdrl_cat_def.h:114
double saturation
Definition hdrl_cat_def.h:84
cpl_size npl_pix
Definition hdrl_cat_def.h:113
cpl_size icrowd
Definition hdrl_cat_def.h:85
cpl_size ipstack
Definition hdrl_cat_def.h:74
cpl_size multiply
Definition hdrl_cat_def.h:79
double rcore
Definition hdrl_cat_def.h:109
cpl_size ipnop
Definition hdrl_cat_def.h:72
cpl_size maxbl
Definition hdrl_cat_def.h:70
cpl_size pnbp
Definition hdrl_cat_def.h:96
double filtfwhm
Definition hdrl_cat_def.h:110
cpl_size nbx
Definition hdrl_cat_def.h:117
double thresh
Definition hdrl_cat_def.h:76
cpl_size pnop
Definition hdrl_cat_def.h:93
cpl_size nimages
Definition hdrl_cat_def.h:73
double fconst
Definition hdrl_cat_def.h:83
double areal_offset
Definition hdrl_cat_def.h:82
cpl_size lsiz
Definition hdrl_cat_def.h:67
double sigma
Definition hdrl_cat_def.h:78
cpl_size maxip
Definition hdrl_cat_def.h:69
cpl_size nby
Definition hdrl_cat_def.h:118
cpl_size ibstack
Definition hdrl_cat_def.h:75
cpl_size first
Definition hdrl_cat_def.h:91
plstruct * plarray
Definition hdrl_cat_def.h:111
cpl_image * inframe
Definition hdrl_cat_def.h:103
cpl_size growing
Definition hdrl_cat_def.h:94
cpl_size touch
Definition hdrl_cat_def.h:95
Definition hdrl_cat_def.h:124
double peak
Definition hdrl_cat_def.h:129
double xx
Definition hdrl_cat_def.h:130
double yy
Definition hdrl_cat_def.h:132
double xy
Definition hdrl_cat_def.h:131
double y
Definition hdrl_cat_def.h:126
double ecc
Definition hdrl_cat_def.h:133
double total
Definition hdrl_cat_def.h:127
cpl_size area
Definition hdrl_cat_def.h:128
double x
Definition hdrl_cat_def.h:125
Definition hdrl_cat_def.h:139
cpl_propertylist * ehu
Definition hdrl_cat_def.h:141
cpl_image * image
Definition hdrl_cat_def.h:140
Definition hdrl_cat_def.h:145
cpl_table * table
Definition hdrl_cat_def.h:146
cpl_propertylist * ehu
Definition hdrl_cat_def.h:147
Definition hdrl_cat_def.h:161
cpl_image * background
Definition hdrl_cat_def.h:164
cpl_image * segmentation_map
Definition hdrl_cat_def.h:163
hdrl_casu_tfits * catalogue
Definition hdrl_cat_def.h:162