HAWKI Pipeline Reference Manual  1.8.12
hawki_distortion.h
1 /* $Id: hawki_distortion.h,v 1.13 2012/12/07 14:09:12 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/07 14:09:12 $
24  * $Revision: 1.13 $
25  * $Name: hawki-1_8_12 $
26  */
27 
28 #ifndef HAWKI_DISTORTION_H
29 #define HAWKI_DISTORTION_H
30 
31 /*-----------------------------------------------------------------------------
32  Includes
33  -----------------------------------------------------------------------------*/
34 
35 #include <cpl.h>
36 
37 /*-----------------------------------------------------------------------------
38  Structures and typedefs
39  -----------------------------------------------------------------------------*/
40 
41 typedef struct _hawki_distortion_ hawki_distortion;
42 
43 struct _hawki_distortion_
44 {
45  cpl_image * dist_x;
46  cpl_image * dist_y;
47  double x_crval;
48  double x_cdelt;
49  double y_crval;
50  double y_cdelt;
51 };
52 
53 /*-----------------------------------------------------------------------------
54  Prototypes
55  -----------------------------------------------------------------------------*/
56 
57 CPL_BEGIN_DECLS
58 hawki_distortion * hawki_distortion_grid_new
59 (int detector_nx,
60  int detector_ny,
61  int grid_size);
62 
64 (hawki_distortion * distortion);
65 
66 hawki_distortion * hawki_distortion_load
67 (const cpl_frame * dist_x,
68  const cpl_frame * dist_y,
69  int idet);
70 
72 (const hawki_distortion * distortion);
73 
75 (const hawki_distortion * distortion);
76 
78 (cpl_image ** alldetectors,
79  const cpl_frame * distortion_x,
80  const cpl_frame * distortion_y) ;
81 
83 (cpl_image * image,
84  cpl_image * dist_x,
85  cpl_image * dist_y);
86 
88 (const hawki_distortion * distortion,
89  double x_pos,
90  double y_pos,
91  double * x_pos_distcorr,
92  double * y_pos_distcorr);
93 
95 (const hawki_distortion * distortion,
96  double x_pos,
97  double y_pos,
98  double * x_pos_distdecorr,
99  double * y_pos_distdecorr);
100 
102 (cpl_imagelist * ilist,
103  cpl_image ** dist_x,
104  cpl_image ** dist_y);
105 
106 int hawki_distortion_create_maps_detector
107 (const hawki_distortion * distortion,
108  cpl_image * dist_detector_x,
109  cpl_image * dist_detector_y);
110 
111 int hawki_distortion_create_maps
112 (const hawki_distortion * distortion,
113  cpl_image ** dist_x,
114  cpl_image ** dist_y);
115 
116 hawki_distortion * hawki_distortion_compute_solution
117 (const cpl_table ** ref_catalogues,
118  const cpl_bivector * cat_offsets,
119  const cpl_table * matching_sets,
120  int ncats,
121  int detector_nx,
122  int detector_ny,
123  int grid_size,
124  const hawki_distortion * dist_initguess,
125  double * rms);
126 CPL_END_DECLS
127 
128 #endif