SINFONI Pipeline Reference Manual  2.5.2
sinfo_functions.h
1 /* $Id: sinfo_functions.h,v 1.13 2009-03-04 10:17:38 amodigli Exp $
2  *
3  * This file is part of the SINFONI Pipeline
4  * Copyright (C) 2002,2003 European Southern Observatory
5  *
6  * This proram 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: amodigli $
23  * $Date: 2009-03-04 10:17:38 $
24  * $Revision: 1.13 $
25  * $Name: not supported by cvs2svn $
26  */
27 #ifndef SINFO_FUNCTIONS_H
28 #define SINFO_FUNCTIONS_H
29 
30 #include <cpl.h>
31 #include <sinfo_time.h>
32 #include <sinfo_globals.h>
33 #include <sinfo_skycor.h>
34 
35 CPL_BEGIN_DECLS
36 
37 int sinfo_print_rec_status(const int val);
38 
39 cpl_frameset *
40 sinfo_frameset_extract(const cpl_frameset *frames,const char *tag);
41 
42 int
43 sinfo_propertylist_has(cpl_propertylist* plist,const char* key);
44 
45 cpl_vector*
46 sinfo_vector_clip(const cpl_vector* vinp,
47  const double kappa,
48  const int n,
49  const int method);
50 
51 
52 int
53 sinfo_image_estimate_noise(cpl_image* img,
54  const int noise_fit,
55  double* centre,
56  double* noise);
57 
58 
59 cpl_table* sinfo_compute_gain(cpl_frameset* son, cpl_frameset* sof);
60 cpl_table* sinfo_compute_linearity(cpl_frameset* son, cpl_frameset* sof);
61 cpl_error_code sinfo_fit_lm(const cpl_matrix *x,
62  const cpl_matrix *sigma_x,
63  const cpl_vector *y,
64  const cpl_vector *sigma_y,
65  cpl_vector *a,
66  const int ia[],
67  int (*f)(const double x[],
68  const double a[],
69  double *result),
70  int (*dfda)(const double x[],
71  const double a[],
72  double result[]),
73  double *mse,
74  double *red_chisq,
75  cpl_matrix **covariance);
76 
77 void
78 sinfo_fit_amoeba(double**p,
79  double y[],
80  int ndim,
81  double ftol,
82  double (*funk)(double[]),
83  int* nfunk);
84 
85 int sinfo_vector_dindgen(cpl_vector** v);
86 int sinfo_is_fits_file(const char *filename);
87 cpl_error_code
88 sinfo_extract_frames_group_type(const cpl_frameset * set,
89  cpl_frameset** ext, cpl_frame_group type);
90 cpl_error_code sinfo_frameset_merge(cpl_frameset * set1,
91  cpl_frameset* set2);
92 cpl_error_code
93 sinfo_table_correl(cpl_table * t1,
94  cpl_table* t2,
95  cpl_table* range,
96  double* xcor);
97 int
98 sinfo_get_pupil_shift(cpl_imagelist* iml,const int n,cpl_table** qclog_tbl);
99 int sinfo_get_preoptic(const char* file,const char* val);
100 int sinfo_get_keyvalue_int(cpl_frame * ref_frame, const char* key_name);
101 float sinfo_get_keyvalue_float(cpl_frame * ref_frame, const char* key_name);
102 double sinfo_get_keyvalue_double(cpl_frame * ref_frame, const char* key_name);
103 char sinfo_get_keyvalue_bool(cpl_frame * ref_frame, const char* key_name);
104 const char*
105 sinfo_get_keyvalue_string(cpl_frame * ref_frame, const char* key_name);
106 int sinfo_get_strehl_type(cpl_frameset* sof);
107 double sinfo_get_wave_cent(const char* band);
108 void sinfo_memory_status(void);
109 int sinfo_check_rec_status(const int val);
110 void
111 sinfo_add_pro_fits_key(cpl_propertylist * plist,
112  char* pro_catg,
113  char* file_name,
114  char* out_name);
115 /* ----------------------------------------------------------------------
116  group of frames
117 ---------------------------------------------------------------------- */
118 
119 
120 
121 int
122 sinfoni_extract_raw_linearity_frames(cpl_frameset * sof, cpl_frameset** raw);
123 int sinfoni_extract_raw_dark_frames(cpl_frameset * sof, cpl_frameset** raw);
124 int sinfo_extract_raw_pinhole_frames(cpl_frameset * sof, cpl_frameset** raw);
125 int sinfo_extract_raw_slit_frames(cpl_frameset * sof, cpl_frameset** raw);
126 int sinfo_extract_raw_stack_frames(cpl_frameset * sof, cpl_frameset** pro);
127 int sinfo_extract_on_frames(cpl_frameset * sof, cpl_frameset* on);
128 int sinfo_extract_off_frames(cpl_frameset * sof, cpl_frameset* off);
129 
130 int sinfo_extract_raw_frames(cpl_frameset * sof, cpl_frameset** raw);
131 int sinfoni_extract_pro_frames(cpl_frameset * sof, cpl_frameset** pro);
132 int sinfo_extract_cdb_frames(cpl_frameset * sof, cpl_frameset** cdb);
133 
134 int sinfo_extract_obj_frames(cpl_frameset * sof, cpl_frameset* obj);
135 int sinfo_extract_sky_frames(cpl_frameset * sof, cpl_frameset* sky);
136 int sinfo_extract_mst_frames(cpl_frameset * sof, cpl_frameset* cdb);
137 int sinfo_extract_stk_frames(cpl_frameset * sof, cpl_frameset* res);
138 int
139 sinfo_extract_preoptic_frames(cpl_frameset * sof,
140  cpl_frameset** res,
141  const char* pre_opt);
142 
143 double sinfo_get_cumoffsetx(cpl_frame * frame);
144 double sinfo_get_cumoffsety(cpl_frame * frame);
145 int sinfo_tag_is_objpro(char * tag);
146 int sinfo_extract_obj_products(cpl_frameset * sof, cpl_frameset* obj);
147 
148 cpl_frameset* sinfo_frameset_join(cpl_frameset* fs1,cpl_frameset* fs2);
149 
150 const char* sinfo_get_pix_scale(float ps);
151 int sinfo_pix_scale_isnot_const(float* pix_scale, int size);
152 
153 int sinfo_contains_frames_kind(cpl_frameset * sof,
154  cpl_frameset* raw,
155  const char* type);
156 
157 int sinfo_contains_frames_type(cpl_frameset * sof,
158  cpl_frameset** raw,
159  const char* type);
160 
161 
162 int sinfo_extract_raw_frames_type(cpl_frameset * sof,
163  cpl_frameset** raw,
164  const char* type);
165 
166 int sinfo_extract_raw_frames_type2(cpl_frameset * sof,
167  cpl_frameset** raw,
168  const char* type);
169 
170 int sinfo_extract_raw_frames_type1(cpl_frameset * sof,
171  cpl_frameset* raw,
172  const char* type);
173 
174 int sinfo_extract_frames_type(cpl_frameset * sof,
175  cpl_frameset * raw,
176  const char* type);
177 
178 int sinfo_remove_qc_frames(cpl_frameset* sof,cpl_frameset** raw);
179 /* ----------------------------------------------------------------------
180  single frames
181 ---------------------------------------------------------------------- */
182 double sinfo_get_mjd_obs(cpl_frame * frame);
183 int sinfo_frame_is_raw(char * tag);
184 int sinfoni_frame_is_pro(char * tag);
185 int sinfo_frame_is_cdb(char * tag);
186 int sinfo_frame_is_stk(char * tag);
187 int sinfo_frame_is_preoptic(cpl_frame*, const char* val);
188 
189 int sinfo_frame_is_pinhole_lamp(char * tag);
190 int sinfo_frame_is_raw_stack(char * tag);
191 int sinfo_frame_is_slit_lamp(char * tag);
192 
193 
194 int sinfo_is_flat_bp(char * tag);
195 int sinfo_is_flat_lindet(char * tag);
196 int sinfo_is_dark(char * tag);
197 int sinfoni_is_pinhole_lamp(char * tag) ;
198 int sinfoni_is_raw_stack(char * tag) ;
199 
200 int sinfoni_is_lamp_slit(char * tag) ;
201 int sinfo_is_sky_flat(char * tag) ;
202 
203 int sinfo_is_mflat(char * tag) ;
204 int sinfo_is_master_flat(char * tag) ;
205 int sinfo_is_master_flat_dither(char * tag) ;
206 
207 int sinfo_is_stack(char * tag) ;
208 int sinfo_is_lamp_wave_stacked(char * tag) ;
209 int sinfo_is_lamp_flux_stacked(char * tag) ;
210 int sinfo_is_psf_calibrator_stacked(char * tag) ;
211 int sinfo_is_focus_stacked(char * tag) ;
212 int sinfo_is_object_nodding_stacked(char * tag) ;
213 int sinfo_is_sky_nodding_stacked(char * tag) ;
214 int sinfo_is_object_skyspider_stacked(char * tag) ;
215 
216 
217 int sinfo_blank2dot(const char * in, char* ou) ;
218 int sinfo_is_bpmap(char *) ;
219 int sinfo_is_slitpos(char * tag) ;
220 int sinfo_is_wavemap(char * tag) ;
221 int sinfo_is_halosp(char * tag) ;
222 int sinfo_is_distlist(char * tag) ;
223 int sinfo_is_firstcol(char * tag) ;
224 int sinfo_is_fibres_on_off(cpl_frameset * sof,
225  cpl_frameset* raw);
226 /* ----------------------------------------------------------------------
227  Extra functionalities
228 ---------------------------------------------------------------------- */
229 int
230 sinfo_clean_nan(cpl_image** im);
231 
232 int sinfo_get_clean_mean_window(cpl_image* img,
233  int llx,
234  int lly,
235  int urx,
236  int ury,
237  const int kappa,
238  const int nclip,
239  double* sinfo_clean_mean,
240  double* clean_stdev);
241 
242 int sinfo_get_obsname(cpl_frame * ref_frame, const char* ob_name);
243 
244 
245  int sinfo_get_ron(cpl_frameset * framelist,
246  const int ron_xmin,
247  const int ron_xmax,
248  const int ron_ymin,
249  const int ron_ymax,
250  const int ron_hsize,
251  const int ron_nsamp,
252  double** ron);
253 int sinfo_stack_get_pro_tag(char * tag_in, char* tag_out) ;
254 int sinfo_compare_tags(const cpl_frame *, const cpl_frame *) ;
255 
256 int sinfo_get_spatial_res(cpl_frame * ref_frame,char * spat_res);
257 int sinfo_frame_is_dither(cpl_frame * ref_frame);
258 int sinfo_frame_is_sky(cpl_frame * ref_frame);
259 int sinfo_tag_is_obj(char * ref_frame);
260 int sinfo_tag_is_sky(char * ref_frame);
261 
262 int sinfo_frame_is_on(cpl_frame * ref_frame);
263 int sinfo_get_band(cpl_frame * ref_frame,char * band);
264 int sinfo_get_ins_set(char* band,int* ins_set);
265 int sinfoni_get_ins_setting(cpl_frame * ref_file,char * set_id);
266 int sinfo_pfits_add_qc(cpl_propertylist * plist,qc_log * qclog);
267 
268 
269 
270 
271 
272 
273 CPL_END_DECLS
274 
275 #endif