High-Level Data Reduction Library: catalogue/hdrl_cat_def.h Source File

High-Level Data Reduction Library 1.6.0 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
55 typedef struct {
56 cpl_size x; /* */
57 cpl_size y; /* */
58 double z; /* */
59 double zsm; /* */
60 cpl_size iobj; /* */
61} plstruct;
62
63 typedef 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
124 typedef 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 */
139 typedef struct {
140 cpl_image *image; /* */
141 cpl_propertylist *ehu; /* */
142} hdrl_casu_fits;
143
144/* cpl_table functions */
145 typedef struct {
146 cpl_table *table; /* */
147 cpl_propertylist *ehu; /* */
148} hdrl_casu_tfits;
149
150
151#define HDRL_SATURATION_INIT INFINITY
152
153 typedef enum {
154 HDRL_CATALOGUE_BKG = 1,
155 HDRL_CATALOGUE_SEGMAP = 2,
156 HDRL_CATALOGUE_CAT_COMPLETE = 4,
157 HDRL_CATALOGUE_ALL = 7
158} hdrl_catalogue_options;
159
160/* Catalogue structure */
161 typedef struct {
162 hdrl_casu_tfits *catalogue; /* cpl_table and property list */
163 cpl_image *segmentation_map; /* */
164 cpl_image *background; /* */
165} hdrl_casu_result;
166
167
168#endif /* HDRL_CATALOGUE_DEF_H */
NAREAL
#define NAREAL
Definition hdrl_cat_def.h:42
hdrl_catalogue_options
hdrl_catalogue_options
Definition hdrl_cat_def.h:153
HDRL_CATALOGUE_ALL
@ HDRL_CATALOGUE_ALL
Definition hdrl_cat_def.h:157
HDRL_CATALOGUE_CAT_COMPLETE
@ HDRL_CATALOGUE_CAT_COMPLETE
Definition hdrl_cat_def.h:156
HDRL_CATALOGUE_BKG
@ HDRL_CATALOGUE_BKG
Definition hdrl_cat_def.h:154
HDRL_CATALOGUE_SEGMAP
@ HDRL_CATALOGUE_SEGMAP
Definition hdrl_cat_def.h:155
plstruct
Definition hdrl_cat_def.h:55
plstruct::y
cpl_size y
Definition hdrl_cat_def.h:57
plstruct::iobj
cpl_size iobj
Definition hdrl_cat_def.h:60
plstruct::zsm
double zsm
Definition hdrl_cat_def.h:59
plstruct::x
cpl_size x
Definition hdrl_cat_def.h:56
plstruct::z
double z
Definition hdrl_cat_def.h:58
ap_t
Definition hdrl_cat_def.h:63
ap_t::confdata
double * confdata
Definition hdrl_cat_def.h:106
ap_t::pstack
cpl_size * pstack
Definition hdrl_cat_def.h:99
ap_t::blink
cpl_size * blink
Definition hdrl_cat_def.h:87
ap_t::indata
double * indata
Definition hdrl_cat_def.h:105
ap_t::nbsize
cpl_size nbsize
Definition hdrl_cat_def.h:119
ap_t::csiz
cpl_size csiz
Definition hdrl_cat_def.h:68
ap_t::lastline
cpl_size * lastline
Definition hdrl_cat_def.h:101
ap_t::mulpix
cpl_size mulpix
Definition hdrl_cat_def.h:81
ap_t::npl
cpl_size npl
Definition hdrl_cat_def.h:112
ap_t::mflag
unsigned char * mflag
Definition hdrl_cat_def.h:107
ap_t::xintmin
double xintmin
Definition hdrl_cat_def.h:80
ap_t::background
double background
Definition hdrl_cat_def.h:77
ap_t::plessey
plstruct * plessey
Definition hdrl_cat_def.h:100
ap_t::opmask
cpl_mask * opmask
Definition hdrl_cat_def.h:108
ap_t::bstack
cpl_size * bstack
Definition hdrl_cat_def.h:88
ap_t::bvals
double ** bvals
Definition hdrl_cat_def.h:120
ap_t::conframe
cpl_image * conframe
Definition hdrl_cat_def.h:104
ap_t::maxpa
cpl_size maxpa
Definition hdrl_cat_def.h:71
ap_t::last
cpl_size last
Definition hdrl_cat_def.h:92
ap_t::fwhm
double fwhm
Definition hdrl_cat_def.h:114
ap_t::saturation
double saturation
Definition hdrl_cat_def.h:84
ap_t::npl_pix
cpl_size npl_pix
Definition hdrl_cat_def.h:113
ap_t::icrowd
cpl_size icrowd
Definition hdrl_cat_def.h:85
ap_t::ipstack
cpl_size ipstack
Definition hdrl_cat_def.h:74
ap_t::multiply
cpl_size multiply
Definition hdrl_cat_def.h:79
ap_t::rcore
double rcore
Definition hdrl_cat_def.h:109
ap_t::ipnop
cpl_size ipnop
Definition hdrl_cat_def.h:72
ap_t::maxbl
cpl_size maxbl
Definition hdrl_cat_def.h:70
ap_t::pnbp
cpl_size pnbp
Definition hdrl_cat_def.h:96
ap_t::filtfwhm
double filtfwhm
Definition hdrl_cat_def.h:110
ap_t::nbx
cpl_size nbx
Definition hdrl_cat_def.h:117
ap_t::thresh
double thresh
Definition hdrl_cat_def.h:76
ap_t::pnop
cpl_size pnop
Definition hdrl_cat_def.h:93
ap_t::nimages
cpl_size nimages
Definition hdrl_cat_def.h:73
ap_t::fconst
double fconst
Definition hdrl_cat_def.h:83
ap_t::areal_offset
double areal_offset
Definition hdrl_cat_def.h:82
ap_t::lsiz
cpl_size lsiz
Definition hdrl_cat_def.h:67
ap_t::sigma
double sigma
Definition hdrl_cat_def.h:78
ap_t::maxip
cpl_size maxip
Definition hdrl_cat_def.h:69
ap_t::nby
cpl_size nby
Definition hdrl_cat_def.h:118
ap_t::ibstack
cpl_size ibstack
Definition hdrl_cat_def.h:75
ap_t::first
cpl_size first
Definition hdrl_cat_def.h:91
ap_t::plarray
plstruct * plarray
Definition hdrl_cat_def.h:111
ap_t::inframe
cpl_image * inframe
Definition hdrl_cat_def.h:103
ap_t::growing
cpl_size growing
Definition hdrl_cat_def.h:94
ap_t::touch
cpl_size touch
Definition hdrl_cat_def.h:95
apmCat_t
Definition hdrl_cat_def.h:124
apmCat_t::peak
double peak
Definition hdrl_cat_def.h:129
apmCat_t::xx
double xx
Definition hdrl_cat_def.h:130
apmCat_t::yy
double yy
Definition hdrl_cat_def.h:132
apmCat_t::xy
double xy
Definition hdrl_cat_def.h:131
apmCat_t::y
double y
Definition hdrl_cat_def.h:126
apmCat_t::ecc
double ecc
Definition hdrl_cat_def.h:133
apmCat_t::total
double total
Definition hdrl_cat_def.h:127
apmCat_t::area
cpl_size area
Definition hdrl_cat_def.h:128
apmCat_t::x
double x
Definition hdrl_cat_def.h:125
hdrl_casu_fits
Definition hdrl_cat_def.h:139
hdrl_casu_fits::ehu
cpl_propertylist * ehu
Definition hdrl_cat_def.h:141
hdrl_casu_fits::image
cpl_image * image
Definition hdrl_cat_def.h:140
hdrl_casu_tfits
Definition hdrl_cat_def.h:145
hdrl_casu_tfits::table
cpl_table * table
Definition hdrl_cat_def.h:146
hdrl_casu_tfits::ehu
cpl_propertylist * ehu
Definition hdrl_cat_def.h:147
hdrl_casu_result
Definition hdrl_cat_def.h:161
hdrl_casu_result::background
cpl_image * background
Definition hdrl_cat_def.h:164
hdrl_casu_result::segmentation_map
cpl_image * segmentation_map
Definition hdrl_cat_def.h:163
hdrl_casu_result::catalogue
hdrl_casu_tfits * catalogue
Definition hdrl_cat_def.h:162