HAWKI Pipeline Reference Manual  1.8.12
hawki_utils.h
1 /* $Id: hawki_utils.h,v 1.43 2012/12/06 16:55:32 cgarcia Exp $
2  *
3  * This file is part of the HAWKI Pipeline
4  * Copyright (C) 2002,2003 European Southern Observatory
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  */
20 
21 /*
22  * $Author: cgarcia $
23  * $Date: 2012/12/06 16:55:32 $
24  * $Revision: 1.43 $
25  * $Name: hawki-1_8_12 $
26  */
27 
28 #ifndef HAWKI_UTILS_H
29 #define HAWKI_UTILS_H
30 
31 /*-----------------------------------------------------------------------------
32  Includes
33  -----------------------------------------------------------------------------*/
34 
35 #include <cpl.h>
36 
37 /*-----------------------------------------------------------------------------
38  New types
39  -----------------------------------------------------------------------------*/
40 
41 typedef enum _HAWKI_BAND_ {
42  HAWKI_BAND_J,
43  HAWKI_BAND_H,
44  HAWKI_BAND_K,
45  HAWKI_BAND_Y,
46  HAWKI_BAND_UNKNOWN
47 } hawki_band ;
48 
49 /*-----------------------------------------------------------------------------
50  Define
51  -----------------------------------------------------------------------------*/
52 
53 #define HAWKI_NB_DETECTORS 4
54 #define HAWKI_PHOT_STAR_RADIUS 30.0
55 #define HAWKI_DET_NPIX_X 2048
56 #define HAWKI_DET_NPIX_Y 2048
57 
58 /* Input from commissionning 1 report */
59 #define HAWKI_DET1_POSX 0
60 #define HAWKI_DET1_POSY 0
61 #define HAWKI_DET2_POSX 2048 + 153
62 #define HAWKI_DET2_POSY 0 + 3
63 #define HAWKI_DET3_POSX 2048 + 157
64 #define HAWKI_DET3_POSY 2048 + 144
65 #define HAWKI_DET4_POSX 0 + 5
66 #define HAWKI_DET4_POSY 2048 + 142
67 
68 #define HAWKI_NB_VC 32
69 
70 #define HAWKI_HEADER_EXT_FORWARD "DET CHIP|DET WIN NX|DET WIN NY|DET WIN STARTX|DET WIN STARTY"
71 
72 #define HAWKI_HEADER_WCS "CTYPE1|CTYPE2|CRVAL1|CRVAL2|CRPIX1|CRPIX2|CD1_1|CD1_2|CD2_1|CD2_2"
73 
74 #define HAWKI_HEADER_COMB_OFFSETS "ESO QC COMBINED"
75 
76 #define HAWKI_HEADER_PRI_TOPAF "^(ARCFILE|MJD-OBS|INSTRUME|ESO TPL ID|ESO TPL NEXP|ESO DPR CATG|ESO DPR TECH|ESO DPR TYPE|DATE-OBS|ESO INS GRAT NAME|ESO INS GRAT WLEN|ESO INS OPTI1 ID|ESO OBS ID|ESO DET MINDIT|ESO DET RSPEED|ESO DET DIT|ESO DET NDIT|ESO DET NCORRS NAME|ESO INS FILT1 NAME|ESO INS FILT2 NAME|ESO MODE NAME|ESO NDSAMPLES)$"
77 
78 #define HAWKI_HEADER_EXT_TOPAF "ESO DET CHIP ID|ESO DET CHIP NO|ESO DET CHIP LIVE"
79 
80 /*-----------------------------------------------------------------------------
81  Prototypes
82  -----------------------------------------------------------------------------*/
83 
84 CPL_BEGIN_DECLS
85 void hawki_print_banner(void);
86 const char * hawki_get_license(void);
87 const char * hawki_get_version(void);
88 
89 cpl_image * hawki_compute_lsbg
90 (const cpl_image * in);
91 cpl_image * hawki_compute_darkbpm
92 (const cpl_image * in,
93  double sigma);
94 cpl_image * hawki_compute_flatbpm
95 (const cpl_image * in,
96  double sigma,
97  double lowval,
98  double highval);
99 cpl_error_code hawki_image_inverse_threshold
100 (cpl_image * image_in,
101  double lo_valid,
102  double hi_valid,
103  double assign_in_range,
104  double assign_out_range);
106 (cpl_imagelist * in,
107  double h1,
108  double h2,
109  double h3,
110  double h4);
112 (const cpl_imagelist * in,
113  double * h1,
114  double * h2,
115  double * h3,
116  double * h4,
117  double * h);
118 const char * hawki_extract_first_filename
119 (const cpl_frameset * in,
120  const char * tag);
121 hawki_band hawki_get_band
122 (const char * band);
123 const char * hawki_std_band_name
124 (hawki_band band);
125 cpl_image * hawki_images_stitch
126 (cpl_image ** ima,
127  double * x,
128  double * y);
129 cpl_bivector * hawki_get_header_tel_offsets
130 (const cpl_frameset * frameset);
131 double hawki_get_mean_airmass(cpl_frameset * set);
133 (const cpl_frameset * frameset);
135 (const cpl_frameset * in,
136  double star_ra,
137  double star_dec,
138  int * labels);
140 (const cpl_vector * self, const cpl_vector * valid);
142 (const cpl_vector * self, const cpl_vector * valid);
143 double hawki_vector_get_mode(cpl_vector * vec);
145 (cpl_frameset * frames, double (*func)(const cpl_propertylist *));
147 (cpl_frameset * frames, int (*func)(const cpl_propertylist *));
148 void hawki_utils_ra2str(char * str, int length_str, double ra);
149 void hawki_utils_dec2str(char * str, int length_str, double dec);
150 cpl_error_code hawki_frameset_append
151 (cpl_frameset *self, const cpl_frameset *other);
152 CPL_END_DECLS
153 
154 #endif