X-shooter Pipeline Reference Manual 3.8.15
xsh_efficiency_response.c
Go to the documentation of this file.
1/* *
2 * This file is part of the ESO X-shooter Pipeline *
3 * Copyright (C) 2006 European Southern Observatory *
4 * *
5 * This library 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, 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA *
18 * */
19
20/*
21 * $Author: amodigli $
22 * $Date: 2013-04-15 12:37:13 $
23 * $Revision: 1.19 $
24 */
25
26
27#ifdef HAVE_CONFIG_H
28#include <config.h>
29#endif
31#include <xsh_error.h>
32
34 {1105.0, 1266.0},
35 {1300.0, 1343.0},
36 {1468.0, 1780.0},
37 {1940.0, 1994.0},
38 {2030.0, 2046.0},
39 {2080.0, 2100.0},
40 {0., 0.}
41} ;
42
43
45 {691., 695.},
46 {715., 734.},
47 {766., 770.},
48 {893., 904.},
49 {943., 983.},
50 {0., 0.}
51 } ;
52
53
55 {0., 0.}
56 } ;
57
59 {1039.0, 1041.0}, // 1040.0 nm
60 {1059.0, 1061.0}, // 1060.0 nm
61 {1190.0, 1192.0}, // 1191.0 nm
62 {1228.0, 1230.0}, // 1229.0 nm
63 {1243.0, 1245.0}, // 1244.0 nm
64 {1552.0, 1554.0}, // 1553.0 nm
65 {1589.0, 1591.0}, // 1590.0 nm
66 {1619.0, 1621.0}, // 1620.0 nm
67 {1658.0, 1660.0}, // 1659.0 nm
68 {1691.0, 1693.0}, // 1692.0 nm
69 {1702.0, 1704.0}, // 1703.0 nm
70 {1709.0, 1711.0}, // 1710.0 nm
71 {1717.0, 1719.0}, // 1718.0 nm
72 {1990.0, 1992.0}, // 1991.0 nm
73 {2036.0, 2038.0}, // 2037.0 nm
74 {2102.0, 2103.0}, // 2102.0 nm
75 {2112.0, 2114.0}, // 2113.0 nm
76 {2125.0, 2127.0}, // 2126.0 nm
77 {2132.0, 2134.0}, // 2133.0 nm
78 {2137.0, 2139.0}, // 2138.0 nm
79 {2141.0, 2143.0}, // 2142.0 nm
80 {2144.0, 2146.0}, // 2145.0 nm
81 {2156.0, 2158.0}, // 2157.0 nm
82 {2163.0, 2165.0}, // 2164.0 nm
83 {2186.0, 2188.0}, // 2187.0 nm
84 {2209.0, 2211.0}, // 2210.0 nm
85 {2239.0, 2241.0}, // 2240.0 nm
86 {2259.0, 2261.0}, // 2260.0 nm
87 {2279.0, 2281.0}, // 2280.0 nm
88 {2306.0, 2308.0}, // 2307.0 nm
89 {2324.0, 2326.0}, // 2325.0 nm
90 {2342.0, 2344.0}, // 2343.0 nm
91 {2379.0, 2381.0}, // 2380.0 nm
92 {2429.0, 2431.0}, // 2430.0 nm
93 {2475.0, 2477.0}, // 2476.0 nm
94 {0., 0.}
95} ;
96
97
99 {1039.0, 1041.0}, // 1040.0 nm
100 {1059.0, 1061.0}, // 1060.0 nm
101 {1190.0, 1192.0}, // 1191.0 nm
102 {1228.0, 1230.0}, // 1229.0 nm
103 {1243.0, 1245.0}, // 1244.0 nm
104 {1552.0, 1554.0}, // 1553.0 nm
105 {1589.0, 1591.0}, // 1590.0 nm
106 {1619.0, 1621.0}, // 1620.0 nm
107 {1658.0, 1660.0}, // 1659.0 nm
108 {1691.0, 1693.0}, // 1692.0 nm
109 {1702.0, 1704.0}, // 1703.0 nm
110 {1709.0, 1711.0}, // 1710.0 nm
111 {1717.0, 1719.0}, // 1718.0 nm
112 {1990.0, 1992.0}, // 1991.0 nm
113 {2036.0, 2038.0}, // 2037.0 nm
114 {0., 0.}
115} ;
116
118 {535.4, 536.2}, // 535.8 +/- 0.4
119 {551.9, 552.7}, // 552.3
120 {555.8, 556.6}, // 556.2
121 {563.6, 564.4}, // 564.0
122 {603.6, 604.4}, // 604.0
123 {616.6, 617.4}, // 617.0
124 {638.6, 639.4}, // 639.0
125 {682.9, 683.7}, // 683.3
126 {707.3, 708.1}, // 707.7
127 {747.1, 747.9}, // 747.5
128 {753.9, 754.7}, // 754.3
129 {777.7, 778.3}, // 777.9
130 {781.1, 781.9}, // 781.5
131 {789.2, 790.0}, // 789.6
132 {799.3, 800.1}, // 799.7
133 {809.6, 810.4}, // 810.0
134 {841.0, 841.8}, // 841.4
135 {850.1, 850.9}, // 850.5
136 {864.6, 865.4}, // 865.0
137 {874.6, 875.4}, // 875.0
138 {887.9, 888.7}, // 888.3
139 {923.4, 924.2}, // 923.8
140 {971.2, 972.0}, // 971.6
141 {979.4, 980.2}, // 979.8
142 {995.2, 996.0}, // 995.6
143 {1006.1, 1006.9}, // 1006.5
144 {1017.6, 1018.4}, // 1018.0
145 {0., 0.}
146 } ;
147
148
150 {0., 0.}
151 } ;
152
153/*
154HIGH_ABS_REGION NirHighAbsRegions[] = {
155 {1060.0, 1232.9}, // nm
156 {1247.4, 1500.0}, // nm
157 {1549.0, 1588.5}, // nm
158 {1595.0, 1625.0}, // nm
159 {1630.0, 1983.5}, // nm
160 {1984.2, 1988.1}, // nm
161 {1988.9, 1991.1}, // nm
162 {1991.7, 2138.0}, // nm
163 {2145.0, 2191.0}, // nm
164 {2218.0, 2271.0}, // nm
165 {2351.0, 2431.0}, // nm
166 {0., 0.}
167} ;
168
169*/
170/* 1.5.31-2.0.8
171HIGH_ABS_REGION NirHighAbsRegions[] = {
172 //{1080.0, 1180.0}, // nm
173 {1247.4, 1450.0}, // nm
174 {1500.0, 2138.0}, // nm
175 //{1247.4, 1500.0}, // nm
176 //{1770.0, 1983.5}, // nm
177 //{1991.7, 2138.0}, // nm
178 {2145.0, 2191.0}, // nm
179 {2218.0, 2271.0}, // nm
180 {0., 0.}
181} ;
182*/
183
184/* 2.0.9 */
185
186
188 {1076.0, 1176.0}, // nm (water vapour)
189 {1236.0, 1296.0}, // nm (water vapour)
190 {1316.0, 1506.0}, // nm (region between J and H)
191 {1736.0, 1986.0}, // nm (region between H and K)
192 {1996.0, 2036.0}, // nm (region between H and K)
193 {2046.0, 2086.0}, // nm (region between H and K)
194 {0., 0.}
195} ;
196
197
199 {1076.0, 1176.0}, // nm (water vapour)
200 {1236.0, 1296.0}, // nm (water vapour)
201 {1316.0, 1506.0}, // nm (region between J and H)
202 {1736.0, 1986.0}, // nm (region between H and K)
203 {1996.0, 2036.0}, // nm (region between H and K)
204 {2046.0, 2086.0}, // nm (region between H and K)
205 {0., 0.}
206} ;
207
208
209/* Sabine's list
210HIGH_ABS_REGION NirHighAbsRegions[] = {
211 {1113.0, 1164.0}, // nm
212 {1337.0, 1507.0}, // nm
213 {1754.0, 1974.0}, // nm
214 {1988.0, 2026.0}, // nm
215 {2045.0, 2088.0}, // nm
216 {0., 0.}
217} ;
218*/
219
220/* 1.5.31
221HIGH_ABS_REGION VisHighAbsRegions[] = {
222 {500.0, 540.0}, // nm
223 {585.0, 604.0}, // nm
224 {632.0, 644.0}, // nm
225 {684.5, 695.0}, // nm
226 {695.5, 714.0}, // nm
227 {740.0, 775.5}, // nm
228 {783.7, 856.0}, // nm
229 {887.5, 993.4}, // nm
230 {0., 0.}
231} ;
232*/
233/* Sabine's list:
234HIGH_ABS_REGION VisHighAbsRegions[] = {
235 {684.0, 696.0}, // nm
236 {756.0, 773.0}, // nm
237 {810.0, 835.0}, // nm
238 {893.0, 923.0}, // nm
239 {927.0, 966.0}, // nm
240 {966.0, 980.0}, // nm
241 {0., 0.}
242} ;
243*/
244
245/* 1.5.32 */
247 {500.0, 532.0}, // nm
248 {634.0, 642.0}, // nm
249 {684.5, 696.0}, // nm
250 {758.0, 770.0}, // nm
251 {812.0, 819.0}, // nm
252 {894.0, 924.0}, // nm
253 {928.0, 968.0}, // nm
254 {974.0, 984.0}, // nm
255 {0., 0.}
256} ;
257
258
260 {556.0, 580.0}, // nm
261 {0., 0.}
262} ;
263
264
265
269 cpl_frame* high_abs_frame)
270{
271 HIGH_ABS_REGION * phigh=NULL;
272 int nrow=0;
273 double* pwmin=0;
274 double* pwmax=0;
275 int i=0;
276 cpl_table* high_abs_tab=NULL;
277 XSH_ARM the_arm;
278
279 if(high_abs_frame !=NULL) {
280 high_abs_tab=cpl_table_load(cpl_frame_get_filename(high_abs_frame),1,0);
281 }
283
284
285
286 if(high_abs_tab!=NULL) {
287 nrow=cpl_table_get_nrow(high_abs_tab);
288 check(pwmin=cpl_table_get_data_double(high_abs_tab,"LAMBDA_MIN"));
289 check(pwmax=cpl_table_get_data_double(high_abs_tab,"LAMBDA_MAX"));
290
291 phigh = (HIGH_ABS_REGION *) cpl_calloc(nrow + 1, sizeof(HIGH_ABS_REGION));
292 for(i=0;i<nrow;i++) {
293 phigh[i].lambda_min=pwmin[i];
294 phigh[i].lambda_max=pwmax[i];
295 }
296 phigh[nrow].lambda_min=0;
297 phigh[nrow].lambda_max=0;
298
299 } else {
300
301 /* Now specific to high absorption region (linear interpolation)
302 NIR and VIS only
303 */
304 if ( the_arm == XSH_ARM_UVB ) {
305 /* Specific UVB */
306 phigh = UvbHighAbsRegions ;
307 }
308 else if ( the_arm == XSH_ARM_VIS ) {
309 /* Specific VIS */
310 phigh = VisHighAbsRegions ;
311 }
312 else if (the_arm == XSH_ARM_NIR) {
313 /* Specific NIR */
314 if (instrument->config->order_min == 13
315 && instrument->config->order_max == 26
316 && instrument->config->orders == 14) {
317 phigh = NirHighAbsRegions;
318 } else {
319 phigh = NirJhHighAbsRegions;
320 }
321 }
322
323 }
324 cleanup:
325 xsh_free_table(&high_abs_tab);
326 return phigh;
327}
328
329
330
334 cpl_frame* high_abs_frame)
335{
336 HIGH_ABS_REGION * phigh=NULL;
337 int nrow=0;
338 double* pwmin=0;
339 double* pwmax=0;
340 int i=0;
341 cpl_table* high_abs_tab=NULL;
342 XSH_ARM the_arm;
343
344 if(high_abs_frame !=NULL) {
345 high_abs_tab=cpl_table_load(cpl_frame_get_filename(high_abs_frame),1,0);
346 }
348
349
350
351 if(high_abs_tab!=NULL) {
352 nrow=cpl_table_get_nrow(high_abs_tab);
353 check(pwmin=cpl_table_get_data_double(high_abs_tab,"LAMBDA_MIN"));
354 check(pwmax=cpl_table_get_data_double(high_abs_tab,"LAMBDA_MAX"));
355
356 phigh = (HIGH_ABS_REGION *) cpl_calloc(nrow + 1, sizeof(HIGH_ABS_REGION));
357 for(i=0;i<nrow;i++) {
358 phigh[i].lambda_min=pwmin[i];
359 phigh[i].lambda_max=pwmax[i];
360 }
361 phigh[nrow].lambda_min=0;
362 phigh[nrow].lambda_max=0;
363
364 } else {
365
366 /* Now specific to high absorption region (linear interpolation)
367 NIR and VIS only
368 */
369 if ( the_arm == XSH_ARM_UVB ) {
370 /* Specific UVB */
371 phigh = UvbTellFitRegions ;
372 }
373 else if ( the_arm == XSH_ARM_VIS ) {
374 /* Specific VIS */
375 phigh = VisTellFitRegions ;
376 }
377 else if ( the_arm == XSH_ARM_NIR ) {
378 /* Specific JH-NIR */
379 if (instrument->config->order_min == 13
380 && instrument->config->order_max == 26
381 && instrument->config->orders == 14) {
382 phigh = NirJhTellFitRegions;
383 } else {
384 /* Specific NIR */
385 phigh = NirTellFitRegions ;
386 }
387 }
388
389 }
390 cleanup:
391 xsh_free_table(&high_abs_tab);
392 return phigh;
393}
394
395
396
400 cpl_frame* high_abs_frame)
401{
402 HIGH_ABS_REGION * phigh=NULL;
403 int nrow=0;
404 double* pwmin=0;
405 double* pwmax=0;
406 int i=0;
407 cpl_table* high_abs_tab=NULL;
408 XSH_ARM the_arm;
409
410 if(high_abs_frame !=NULL) {
411 high_abs_tab=cpl_table_load(cpl_frame_get_filename(high_abs_frame),1,0);
412 }
414
415
416
417 if(high_abs_tab!=NULL) {
418 nrow=cpl_table_get_nrow(high_abs_tab);
419 check(pwmin=cpl_table_get_data_double(high_abs_tab,"LAMBDA_MIN"));
420 check(pwmax=cpl_table_get_data_double(high_abs_tab,"LAMBDA_MAX"));
421
422 phigh = (HIGH_ABS_REGION *) cpl_calloc(nrow + 1, sizeof(HIGH_ABS_REGION));
423 for(i=0;i<nrow;i++) {
424 phigh[i].lambda_min=pwmin[i];
425 phigh[i].lambda_max=pwmax[i];
426 }
427 phigh[nrow].lambda_min=0;
428 phigh[nrow].lambda_max=0;
429
430 } else {
431
432 /* Now specific to high absorption region (linear interpolation)
433 NIR and VIS only
434 */
435 if ( the_arm == XSH_ARM_UVB ) {
436 /* Specific UVB */
438 }
439 else if ( the_arm == XSH_ARM_VIS ) {
440 /* Specific VIS */
442 }
443 else if ( the_arm == XSH_ARM_NIR ) {
444 /* Specific NIR */
446 }
447
448 }
449 cleanup:
450 xsh_free_table(&high_abs_tab);
451 return phigh;
452}
static xsh_instrument * instrument
#define check(COMMAND)
Definition: xsh_error.h:71
XSH_ARM xsh_instrument_get_arm(xsh_instrument *i)
Get an arm on instrument structure.
void xsh_free_table(cpl_table **t)
Deallocate a table and set the pointer to NULL.
Definition: xsh_utils.c:2133
XSH_INSTRCONFIG * config
@ XSH_ARM_UVB
@ XSH_ARM_NIR
@ XSH_ARM_VIS
HIGH_ABS_REGION NirTellComputeResidRegions[]
HIGH_ABS_REGION * xsh_fill_high_abs_regions(xsh_instrument *instrument, cpl_frame *high_abs_frame)
HIGH_ABS_REGION VisHighAbsRegions[]
HIGH_ABS_REGION NirJhHighAbsRegions[]
HIGH_ABS_REGION UvbHighAbsRegions[]
HIGH_ABS_REGION UvbTellFitRegions[]
HIGH_ABS_REGION UvbTellComputeResidRegions[]
HIGH_ABS_REGION NirJhTellFitRegions[]
HIGH_ABS_REGION VisTellFitRegions[]
HIGH_ABS_REGION VisTellComputeResidRegions[]
HIGH_ABS_REGION * xsh_fill_tell_compute_resid_regions(xsh_instrument *instrument, cpl_frame *high_abs_frame)
HIGH_ABS_REGION NirHighAbsRegions[]
HIGH_ABS_REGION NirTellFitRegions[]
HIGH_ABS_REGION * xsh_fill_tell_fit_regions(xsh_instrument *instrument, cpl_frame *high_abs_frame)