X-shooter Pipeline Reference Manual 3.8.15
xsh_drl.h
Go to the documentation of this file.
1/* $Id: xsh_drl.h,v 1.227 2013-03-25 14:47:29 amodigli Exp $
2 *
3 * This file is part of the X-shooter Pipeline
4 * Copyright (C) 2006 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: amodigli $
23 * $Date: 2013-03-25 14:47:29 $
24 * $Revision: 1.227 $
25 * $Name: not supported by cvs2svn $
26 */
27
28#ifndef XSH_DRL_H
29#define XSH_DRL_H
30
31/*-----------------------------------------------------------------------------
32 Includes
33 -----------------------------------------------------------------------------*/
34#include <cpl.h>
35#include <xsh_error.h>
36#include <xsh_dfs.h>
37#include <xsh_utils.h>
38#include <xsh_data_pre.h>
39#include <xsh_data_rec.h>
40#include <xsh_data_instrument.h>
41#include <xsh_data_order.h>
42#include <xsh_data_dispersol.h>
43#include <xsh_parameters.h>
44#include <xsh_qc_handling.h>
45/*-----------------------------------------------------------------------------
46 Defines
47 -----------------------------------------------------------------------------*/
48#define XSH_CONCAT(A,B) A ## B
49#define XSH_STRING(A) # A
50
51#define PICKUP_NOISE_HOT_PIXEL_MAP
52
53/*-----------------------------------------------------------------------------
54 Typedefs
55 -----------------------------------------------------------------------------*/
56
57/*-----------------------------------------------------------------------------
58 Prototypes
59 -----------------------------------------------------------------------------*/
60#define REGDEBUG_OPTEXTRACT 0
61cpl_frame*
62xsh_bpmap_2pre(cpl_frame* bpmap,const char* prefix, xsh_instrument* inst);
63
64void
65xsh_prepare( cpl_frameset* frames, cpl_frame* bpmap, cpl_frame* mbias,
66 const char* prefix, xsh_instrument* instr,
67 const int pre_overscan_corr,const bool flag_neg_and_thresh_pix);
68cpl_frame * xsh_preframe_extract( cpl_frame* frame, int xmin, int ymin,
69 int xmax, int ymax, const char* name, xsh_instrument *instr);
70
71cpl_frame *
72xsh_remove_crh_multiple( cpl_frameset* rawFrames,
73 const char * name,
74 xsh_stack_param* stack_param,
76 xsh_instrument* inst ,
77 cpl_imagelist **,
78 cpl_image** , const int save_tmp) ;
79
80#if defined(PICKUP_NOISE_HOT_PIXEL_MAP)
81cpl_frame *
82xsh_compute_noise_map( cpl_imagelist *, cpl_frame * bpmap,
84 xsh_instrument* instr,
85 cpl_frame ** noisemap ) ;
86#else
87cpl_frame *
88xsh_compute_noise_map( cpl_imagelist *,
89 cpl_frame * bpmap,
91 xsh_instrument* instr) ;
92#endif
93
94cpl_frame *
95xsh_create_master_dark( cpl_frame* bpMap,
96 xsh_instrument* instr,
97 cpl_parameterlist* parameters,
98 cpl_frame* crh_frm,cpl_frame* bp_map_frm);
99
100cpl_frame *
101xsh_create_master_dark2(cpl_frameset * raws,
102 xsh_stack_param* stack_param,
103 cpl_parameterlist* drs_param,
104 cpl_propertylist* qc_log,
105 xsh_instrument* instr);
106
107cpl_frame *
108xsh_compute_qc_on_master_bias (cpl_frameset* raws,
109 cpl_frame * frame,
110 xsh_instrument* instr,
111 cpl_parameterlist* drs_params);
112
113
114cpl_frame * xsh_create_master_flat( cpl_frame* frame,xsh_instrument * instr);
115cpl_frame * xsh_create_master_flat_with_mask( cpl_frame* frame,cpl_frame* edges,xsh_instrument * instr);
116cpl_frame*
117xsh_create_master_flat2(cpl_frameset *set,
118 cpl_frame * order_tab_cen,
119 xsh_stack_param* stack_par,
120 xsh_instrument* inst);
121
122cpl_frame * xsh_create_master_dark_bpmap( cpl_frame* frame,xsh_instrument * instr);
123
124/* compute Linearity related functions */
125cpl_frame * xsh_compute_linearity( cpl_frameset *, xsh_instrument *,
126 xsh_clipping_param *,const int decode_bp ) ;
127
128int
129xsh_linear_group_by_exptime( cpl_frameset *,
131 double ,
132 cpl_frameset ** ) ;
133
134cpl_frame*
135xsh_subtract_bias(cpl_frame* frame,
136 cpl_frame* bias,
137 xsh_instrument* instr,
138 const char* type,
139 const int pre_overscan_corr,const int save_tmp);
140
141cpl_frameset*
142xsh_subtract_nir_on_off(cpl_frameset* on,
143 cpl_frameset* off,
144 xsh_instrument* instr);
145cpl_frame*
146xsh_subtract_dark(cpl_frame * frame,
147 cpl_frame * dark,
148 const char* filename,
149 xsh_instrument* instr);
150
151#define XSH_DIVIDE_FLAT_THRESH 1e-10
152cpl_frame* xsh_divide_flat(cpl_frame * frame, cpl_frame * flat,
153 const char* filename, xsh_instrument* instr);
154
155#define XSH_MULTIPLY_FLAT_THRESH 1e+30
156cpl_frame* xsh_multiply_flat(cpl_frame * frame, cpl_frame * flat,
157 const char* filename, xsh_instrument* instr);
158
159
160cpl_frame*
161xsh_subtract_background(cpl_frame * frame,
162 cpl_frame* ordertable,
164 xsh_instrument* instr,
165 const char* prefix,
166 cpl_frame** grid_frame,
167 cpl_frame** frame_backg,const int save_bkg, const int save_grid, const int save_sub_bkg);
168cpl_frame*
169xsh_detect_order_edge(cpl_frame* frame,
170 cpl_frame* order_table,
171 xsh_detect_order_param * det_param,
172 xsh_instrument* instr);
173
174cpl_frame *
175xsh_detect_continuum( cpl_frame* frame,
176 cpl_frame* order_table,
177 cpl_frame * spectral_format,
179 xsh_clipping_param * dcn_clipping,
180 xsh_instrument* instr,
181 cpl_frame** resid_frame) ;
182
183cpl_frame *
185 cpl_frame * spectral_frame,
186 xsh_detect_continuum_param * detect_param,
188
189/* precision between to rays in nm */
190#define WAVELENGTH_PRECISION 0.00001
191#define SLIT_PRECISION 0.00001
192#define SLIT_PRECISION_IFU 0.21
193
194void xsh_create_map( cpl_frame *dispsol_frame, cpl_frame *ordertab_frame,
195 cpl_frame *pre_frame, xsh_instrument *instrument, cpl_frame **wavemap_frame,
196 cpl_frame **slitmap_frame,const char* rec_prefix);
197
198cpl_frame *
199xsh_create_wavemap( cpl_frame * in_frame,
200 cpl_frame * resid_frame,
201 cpl_frame * order_frame,
202 xsh_dispersol_param * dispersol_param,
204
205cpl_frame * xsh_create_poly_wavemap( cpl_frame *pre_frame,
206 cpl_frame *wave_tab_2d_frame, cpl_frame *order_tab_frame,
207 cpl_frame *spectral_format_frame, xsh_dispersol_param *dispsol_par,
208 xsh_instrument * instrument, const char * filename,
209 cpl_frame **dispersol_frame, cpl_frame **slitmap_frame);
210
211void
212xsh_create_model_map( cpl_frame* model_frame, xsh_instrument* instrument,
213 const char* wave_map_tag, const char* slit_map_tag,
214 cpl_frame **wavemap_frame, cpl_frame **slitmap_frame,const int save_tmp);
215
216cpl_frame *
217xsh_create_order_table( cpl_frame * in_frame,
218 cpl_frame * spectralformat_frame,
219 cpl_frame * resid_frame,
220 cpl_frame * arclines,
222 xsh_clipping_param * dac,
224
225#define XSH_DETECT_ARCLINES_TYPE_POLY 0
226#define XSH_DETECT_ARCLINES_TYPE_MODEL 1
227#define XSH_DETECT_ARCLINES_MODE_NORMAL 0
228#define XSH_DETECT_ARCLINES_MODE_CORRECTED 1
229#define XSH_DETECT_ARCLINES_MODE_RECOVER 2
230
231typedef enum {
235
236void
237xsh_detect_arclines( cpl_frame *frame,
238 cpl_frame *theo_tab_frame,
239 cpl_frame *arc_lines_tab_frame,
240 cpl_frame* wave_tab_guess_frame,
241 cpl_frame *order_tab_recov_frame,
242 cpl_frame *config_model_frame,
243 cpl_frame *spectralformat_frame,
244 cpl_frame **resid_tab_orders_frame,
245 cpl_frame **arc_lines_clean_tab_frame,
246 cpl_frame **wave_tab_frame,
247 cpl_frame **resid_tab_frame,
251 xsh_instrument *instr,
252 const char* rec_id,
253 const int clean_tmp,
254 const int resid_tab_name_sw);
255
256void
257xsh_detect_arclines_dan( cpl_frame *frame,
258 cpl_frame *theo_tab_frame,
259 cpl_frame *arc_lines_tab_frame,
260 cpl_frame* wave_tab_guess_frame,
261 cpl_frame *order_tab_recov_frame,
262 cpl_frame *config_model_frame,
263 cpl_frame *spectralformat_frame,
264 cpl_frame **resid_tab_orders_frame,
265 cpl_frame **arc_lines_clean_tab_frame,
266 cpl_frame **wave_tab_frame,
267 cpl_frame **resid_tab_frame,
271 xsh_instrument *instr,
272 const char* rec_id,
273 const int clean_tmp,
274 const int resid_tab_name_sw);
275
276void
277xsh_follow_arclines_slit( cpl_frame *inframe,
278 cpl_frame *arclines,
279 cpl_frame *wavesol,
280 cpl_frame *order_table,
281 cpl_frame *spectralformat_frame,
282 cpl_frame *model_config_frame,
283 cpl_frame *wavemap_frame,
284 cpl_frame *slitmap_frame,
285 cpl_frame *disptab_frame,
288 cpl_frame ** tilt_list,
289 cpl_frame ** shift_frame);
290
291
292void
293xsh_follow_arclines_ifu( cpl_frame *inframe,
294 cpl_frame *arclines,
295 cpl_frame *wavesol,
296 cpl_frame *order_table,
297 cpl_frame *spectralformat_frame,
298 cpl_frame *model_config_frame,
299 cpl_frame *wavemap_frame,
300 cpl_frame *slitmap_frame,
301 cpl_frame *disptab_frame,
302 xsh_follow_arclines_param *follow_param,
304 cpl_frameset *tilt_set,
305 cpl_frame **shift_frame);
306
307
308void xsh_rec_slit_size( xsh_rectify_param *rectify_par, double *slit_min,
309 int *nslit, XSH_MODE mode);
310
311cpl_frame* xsh_rectify_orders( cpl_frame *sci_frame,
312 xsh_order_list *orderlist_frame,
313 cpl_frame *wavesol_frame, cpl_frame *model_frame, xsh_instrument *instrument,
314 xsh_rectify_param *rectify_par, cpl_frame *spectralformat_frame,
315 cpl_frame *disp_tab_frame, const char * res_name, const char* tag,
316 cpl_frame** res_frame_ext,cpl_frame** res_frame_tab,
317 int min_index, int max_index, double slit_min, int nslit, double slit_shift,
318 cpl_frame *slitshift_tab);
319
320cpl_frameset * xsh_rectify_orders_ifu(cpl_frame *sci_frame,
321 xsh_order_list *orderlist, cpl_frameset *wavesol_frameset,
322 cpl_frameset *shift_frameset,
323 cpl_frame *model_frame, xsh_instrument *instrument,
324 xsh_rectify_param *rectify_par, cpl_frame *spectralformat_frame,
325 cpl_frame * slitmap_frame,cpl_frameset ** rec_frameset_ext, cpl_frameset ** rec_frameset_tab,
326 int min_index, int max_index, const char* rec_prefix);
327
328cpl_frame *
329xsh_rectify (cpl_frame * sci_frame, cpl_frame * order_table_frame,
330 cpl_frame * wavesol_frame,
331 cpl_frame * model_config_frame,
333 xsh_rectify_param * rectify_par,
334 cpl_frame *spectral_format,
335 cpl_frame *disp_tab_frame,
336 const char * fname,
337 cpl_frame** res_frame_ext,cpl_frame ** res_frame_tab,
338 const char* prefix);
339
340cpl_frame * shift_with_kw( cpl_frame * rec_frame,
342 xsh_rectify_param * rectify_par,
343 const char * fname,
344 cpl_frame** res_frame_ext,
345 double **ref_ra, double **ref_dec, int flag);
346
347
348cpl_frame * xsh_rectify_and_shift( cpl_frame *sci_frame,
349 cpl_frame * orderlist_frame,
350 cpl_frame *wavesol_frame,
351 cpl_frame * model_frame,
353 xsh_rectify_param *rectify_par,
354 cpl_frame *spectralformat_frame,
355 cpl_frame * loc_frame,
356 cpl_frame * loc0_frame,
357 double *throw_shift,
358 cpl_frame *disp_tab_frame,
359 const char * res_name,
360 cpl_frame** res_frame_ext,
361 cpl_frame** res_frame_tab);
362
363cpl_frameset *
364xsh_rectify_ifu(cpl_frame * sci_frame,
365 cpl_frame * order_table_frame,
366 cpl_frameset *wavesol_frame_set,
367 cpl_frameset *shiftifu_frameset,
368 cpl_frame * model_config_frame,
370 xsh_rectify_param * rectify_par,
371 cpl_frame * spectral_format,
372 cpl_frame * slitmap_frame,
373 cpl_frameset** rec_frameset_ext,
374 cpl_frameset** rec_frameset_tab,
375 const char* rec_prefix) ;
376
377#define XSH_RECTIFY_TYPE_POLY 0
378#define XSH_RECTIFY_TYPE_MODEL 1
379cpl_frame *
380xsh_shift_rectified( cpl_frame * rec_frame,
381 cpl_frame * loc_frame,
382 cpl_frame * loc0_frame,
383 const char * file_name,
384 xsh_combine_nod_param * combine_nod_param,
385 xsh_rectify_param * rectif_par,
387 cpl_frame** res_frame_ext ) ;
388
390 cpl_frame * slitmap_frame,
391 double * down, double * cen,
392 double * up,
393 XSH_ARM arm ) ;
394
395
396
397void xsh_get_slit_edges( cpl_frame *slitmap_frame, double *sdown, double *sup,
398 double *sldown, double *slup, xsh_instrument *instrument);
399
400void xsh_compute_slitlet_limits( cpl_frameset *shift_set, double sdown,
401 double sldown, double slup, double sup, double slit_bin,
402 double *slitmin_tab, int *nslit_tab, double *slitcen_tab);
403
404cpl_frame *
405xsh_subtract_sky_single (cpl_frame * sci_frame,
406 cpl_frame * order_table_frame,
407 cpl_frame * slitmap_frame,
408 cpl_frame * wavemap_frame,
409 cpl_frame * locTable_frame,
410 cpl_frame* ref_sky_list,
411 cpl_frame* sky_orders_chunks,
412 cpl_frame* usr_defined_break_points_frame,
414 int nbkpts,
416 cpl_frame ** sky_spectrum,
417 cpl_frame ** sky_spectrum_eso,
418 const char* rec_prefix,
419 const int clean_tmp) ;
420
421/*
422cpl_frame*
423xsh_save_sky_model(cpl_frame* obj_frame,
424 cpl_frame* sub_sky_frame,
425 const char* sky_tag,
426 xsh_instrument* instrument);
427 */
428
429cpl_frame * xsh_add_sky_model( cpl_frame *sub_sky_frame, cpl_frame *sky_frame,
430 xsh_instrument * instrument, const char* rec_prefix );
431
432cpl_frame*
433xsh_localize_obj( cpl_frame * sci_frame,
434 cpl_frame *skymask_frame,
436 xsh_localize_obj_param * loc_obj_par,
437 xsh_slit_limit_param * slit_limit_param,
438 const char * fname );
439
440cpl_frameset *
441xsh_localize_obj_ifu( cpl_frameset * sci_frame,
442 cpl_frame *skymask_frame,
444 xsh_localize_obj_param * loc_obj_par,
445 xsh_slit_limit_param * slit_limit_param);
446
447cpl_frame* xsh_extract ( cpl_frame * rec_frame,
448 cpl_frame* loc_frame,
450 xsh_extract_param* extract_par,
451 cpl_frame** res_frame_ext,
452 const char* rec_prefix);
453
454cpl_frame* xsh_extract_clean ( cpl_frame * rec_frame,
455 cpl_frame* loc_frame,
457 xsh_extract_param* extract_par,
458 xsh_interpolate_bp_param * ipol_bp,
459 cpl_frame** res_frame_ext,
460 const char* rec_prefix);
461
462cpl_frameset *
463xsh_extract_ifu(cpl_frameset * rec_frame_set,
464 cpl_frameset * loc_frame_set,
466 xsh_extract_param * extract_par,
467 const char* rec_prefix) ;
468
469cpl_frame * xsh_abs_remove_crh_single( cpl_frame *sci_frame,
471 xsh_remove_crh_single_param * single_par,
472 const char * res_tag);
473
474cpl_frame *
475xsh_remove_crh_single( cpl_frame * sci_frame,
476 xsh_instrument * instrument, cpl_mask* sky_map,
477 xsh_remove_crh_single_param * single_par,
478 const char * name );
479
480cpl_frame * xsh_merge_ord_slitlet( cpl_frame * rec_frame,
482 int merge_par, int slitlet,
483 const char* rec_prefix);
484
485cpl_frame *
486xsh_merge_ord (cpl_frame * sci_frame, xsh_instrument * instrument,
487 int merge,const char* rec_prefix) ;
488
489cpl_frameset *
490xsh_merge_ord_ifu(cpl_frameset * rec_frameset,
492 int merge_par,const char* rec_prefix) ;
493
494
495#define XSH_OBJPOS_NB_COL 2
496#define XSH_OBJPOS_COLNAME_WAVELENGTH "Wavelength"
497#define XSH_OBJPOS_UNIT_WAVELENGTH "nm"
498#define XSH_OBJPOS_COLNAME_SLIT "Slit"
499#define XSH_OBJPOS_UNIT_SLIT "arcsec"
500#define XSH_LAMBDA_DIMM 0.0000005
501
502double xsh_convert_seeing( cpl_frame* frame);
503
504cpl_frame* xsh_localize_ifu_slitlet( cpl_frame *merge2d_slitlet,
505 cpl_frame *skymask_frame, int smooth_hsize,
506 int nscales, int HF_skip, const char* resname, double cut_sigma_low,
507 double cut_sigma_up, double cut_snr_low, double cut_snr_up,
508 double slit_min, double slit_max, int deg, int box_hsize, xsh_instrument *instr);
509
510cpl_frameset* xsh_localize_ifu( cpl_frameset *merge2d_frameset,
511 cpl_frame *skymask_frame,
513 const char* resname);
514
515#define XSH_SHIFTIFU_NB_COL 2
516#define XSH_SHIFTIFU_COLNAME_WAVELENGTH "Wavelength"
517#define XSH_SHIFTIFU_UNIT_WAVELENGTH "nm"
518#define XSH_SHIFTIFU_COLNAME_SHIFTSLIT "Slit_shift"
519#define XSH_SHIFTIFU_UNIT_SHIFTSLIT "arcsec"
520
521cpl_frame* xsh_compute_shift_ifu_slitlet( double lambda_ref, cpl_frame *objpos_frame,
522 cpl_frame *shiftifu_frame, double lambdaref_hsize, const char* resname);
523
524cpl_frameset* xsh_compute_shift_ifu( double lambda_ref, double lambdaref_hsize,
525 cpl_frameset *objpos_frameset,
526 cpl_frameset *shiftifu_frameset, xsh_instrument* instr, const char* prefix);
527
528cpl_frameset *
529xsh_subtract_sky_nod( cpl_frameset * raws, xsh_instrument * instrument,
530 int mode_fast);
531
532void
533xsh_flat_merge_qth_d2( cpl_frame *qth_frame,
534 cpl_frame *qth_order_tab_frame,
535 cpl_frame *d2_frame,
536 cpl_frame *d2_order_tab_frame,
537 cpl_frame *qth_bkg_frame,
538 cpl_frame *d2_bkg_frame,
539 cpl_frame **qth_d2_flat_frame,
540 cpl_frame **qth_d2_bkg_frame,
541 cpl_frame **qth_d2_order_tab_frame,
543void
544xsh_flat_merge_qth_d2_smooth( cpl_frame *qth_frame,
545 cpl_frame *qth_order_tab_frame,
546 cpl_frame *d2_frame,cpl_frame *d2_order_tab_frame,
547 cpl_frame *qth_bkg_frame, cpl_frame *d2_bkg_frame,
548 cpl_frame **qth_d2_flat_frame,
549 cpl_frame **qth_d2_bkg_frame,
550 cpl_frame **qth_d2_order_tab_frame,
552cpl_frame*
553xsh_flat_merge_qth_d2_tabs(cpl_frame *qth_edges_tab,cpl_frame *d2_edges_tab,xsh_instrument *instrument);
554
555
556cpl_error_code
557xsh_extract_clean_slice(const float* flux,
558 const float* errs, int* qual,
559 const double* lambda,
560 const int ilambda,
562 const int slit_min, const int slit_max,
563 const int nlambda,const int nslit,
564 const int mask_hsize,
565 double* fluxval, double* errval, int* qualval,float*,float*,float*);
566
567#define XSH_MATH_SQRT_2 1.4142135623730951
568void xsh_opt_extract( cpl_frame *sci_frame, cpl_frame *order_table_frame,
569 cpl_frame *wavesol_frame, cpl_frame *model_frame, cpl_frame *wavemap_frame,
570 cpl_frame *slitmap_frame, cpl_frame *loc_frame,
571 cpl_frame *spectralformat_frame, cpl_frame *masterflat_frame,
573 const char* rec_prefix,
574 cpl_frame **orderext1d_frame,
575 cpl_frame **orderoxt1d_frame,
576 cpl_frame **orderoxt1d_eso_frame,
577 cpl_frame** qc_subextract_frame,
578 cpl_frame** qc_s2ddiv1d_frame,
579 cpl_frame** qc_model_frame,
580 cpl_frame** qc_weight_frame);
581
582
583#define REGDEBUG_GAUSSIAN 0
584#define REGDEBUG_BLAZE 0
585#define REGDEBUG_EXTRACT 0
586#define REGDEBUG_EXTRACT_XY 0
587#define REGDEBUG_SUBEXTRACT_XY 0
588#define REGDEBUG_EXTRACT_STD 0
589#define REGDEBUG_N 0
590
591void xsh_opt_extract_orders( cpl_frame *sci_frame,
592 cpl_frame *orderlist_frame,
593 cpl_frame *wavesol_frame,
594 cpl_frame *model_frame,
595 cpl_frame *wavemap_frame,
596 cpl_frame *slitmap_frame,
597 cpl_frame *loc_frame,
598 cpl_frame *spectralformat_frame,
599 cpl_frame *masterflat_frame,
601 xsh_opt_extract_param* opt_extract_par,
602 int min_index, int max_index,
603 const char* rec_refix,
604 cpl_frame** orderext1d_frame,
605 cpl_frame** orderoxt1d_frame,
606 cpl_frame** orderoxt1d_eso_frame,
607 cpl_frame** qc_subextract_frame,
608 cpl_frame** qc_s2ddiv1d_frame,
609 cpl_frame** qc_model_frame,
610 cpl_frame** qc_weight_frame);
611
612cpl_frame *
613xsh_combine_nod( cpl_frameset * frames,
614 xsh_combine_nod_param * param,
615 const char * fname,
617 cpl_frame** res_frame_ext,const int scale_nod ) ;
618
619
620cpl_frame*
621xsh_create_master_bias2(cpl_frameset* rawFrames,xsh_stack_param* stack_par,
622 xsh_instrument* instr,
623 const char* result_name,const int method_code);
624
625cpl_frame* xsh_compute_slice_dist( cpl_frameset *loc_frame_set,
626 cpl_frame *order_tab, cpl_frame *slitmap_frame,
627 cpl_frameset *merge_frameset, double lambda, xsh_instrument *instrument);
628
629cpl_frame *
630xsh_format( cpl_frameset * rect_frame_set,
631 const char * result_name,
632 xsh_instrument * instrument, const char* rec_prefix ) ;
633
634cpl_frame* xsh_cube( cpl_frameset *merge2d_frameset,
635 xsh_instrument * instrument, const char* rec_prefix);
636
637void xsh_center_cube( cpl_frame *cube_frame, cpl_frame *sky_line_frame,
638 int chunk_size, xsh_instrument *instrument);
639
640cpl_frameset *
641xsh_subtract_sky_offset( cpl_frameset * object_raws,
642 cpl_frameset * sky_raws,
643 int nraws,
645
646cpl_frame *
647xsh_combine_offset (cpl_frameset * rawFrames,
648 const char *result_name,
649 xsh_stack_param* stack_par,
650 xsh_instrument* instr,
651 cpl_imagelist ** list,
652 cpl_image** crh_ima, const int save_tmp) ;
653
654cpl_frame *
655xsh_compute_response( cpl_frame * rect_frame,
656 cpl_frame * std_star_flux_frame,
657 cpl_frame * atmos_ext_frame,
658 cpl_frame * high_abs_tab_frame,
660 double exptime ) ;
661
662
663cpl_frame *
664xsh_compute_response2( cpl_frame * rect_frame,
665 cpl_frame * std_star_flux_frame,
666 cpl_frame * atmos_ext_frame,
667 cpl_frame * high_abs_tab_frame,
668 cpl_frame* resp_fit_points,
669 cpl_frame * tell_mod_cat_frame,
671 double exptime,const int tell_corr ) ;
672
673cpl_frame *
674xsh_compute_response_ord( cpl_frame * rect_frame,
675 cpl_frame * std_star_flux_frame,
676 cpl_frame * atmos_ext_frame,
677 cpl_frame * high_abs_tab_frame,
679 double exptime) ;
680
681void xsh_data_check_spectralformat( cpl_frame *spectralformat_frame,
682 cpl_frame *orderlist_frame, cpl_frame *wavesol_frame,
683 cpl_frame *model_config,
684 xsh_instrument *instr);
685
686cpl_error_code
687xsh_wavemap_qc(cpl_frame* frm_map,const cpl_frame* frm_tab);
688
689cpl_error_code
690xsh_wavetab_qc(cpl_frame* frm_tab,const int is_poly);
691
692cpl_frame*
693xsh_flexcor( cpl_frame* afc_frame,
694 cpl_frame *wave_tab_frame,
695 cpl_frame *model_config_frame,
696 cpl_frame *order_tab_frame,
697 cpl_frame *attresidtab_frame,
698 int afc_xmin, int afc_ymin, xsh_instrument *instr,
699 cpl_frame **afc_order_tab_frame,
700 cpl_frame **afc_model_config_frame);
701
702cpl_frame* xsh_afcthetab_create( cpl_frame *wave_tab_frame,
703 cpl_frame *model_config_frame, int order,
704 cpl_frame *spectralformat_frame,cpl_frame *arclines_frame,
705 int xmin, int ymin,
706 xsh_instrument *instr,const int clean_tmp);
707
708cpl_frameset* xsh_ifu_wavetab_create( cpl_frame *wave_tab_frame,
709 cpl_frame *shift_tab_frame, xsh_instrument *instr);
710
711cpl_frame * xsh_calibrate_flux( cpl_frame * spectrum_frame,
712 cpl_frame * respon_frame,
713 cpl_frame * atmos_ext_frame,
714 const char * fname,
716
717cpl_frame*
718xsh_create_dispersol_physmod(cpl_frame* pre_frame,
719 cpl_frame *order_tab_frame,
720 cpl_frame* mod_cfg_frame,
721 cpl_frame* wave_map_frame,
722 cpl_frame* slit_map_frame,
723 xsh_dispersol_param *dispsol_param,
724 cpl_frame* spectral_format_frame,
726 const int clean_tmp);
727
728#define LSTART_COLUMN_NAME "LAMBDASTART"
729#define LEND_COLUMN_NAME "LAMBDAEND"
730#define GUESS_TELL_MASK_RESOLUTION_UVB 9100
731#define GUESS_TELL_MASK_RESOLUTION_VIS 17400
732#define GUESS_TELL_MASK_RESOLUTION_NIR 11300
733cpl_frame* xsh_compute_absorp( cpl_frame *s1d_frame, cpl_frame *telllist_frame,
734 int filter_hsize, double threshold, xsh_instrument* instr);
735
736void xsh_mark_tell( cpl_frame *s1d_frame, cpl_frame *tellmask_frame);
737
738#endif
cpl_frame * xsh_create_master_flat2(cpl_frameset *set, cpl_frame *order_tab_cen, xsh_stack_param *stack_par, xsh_instrument *inst)
Combine master frames.
cpl_frame * xsh_compute_qc_on_master_bias(cpl_frameset *raws, cpl_frame *frame, xsh_instrument *instr, cpl_parameterlist *drs_params)
Computes QC on a master bias frame.
cpl_frame * xsh_create_master_flat_with_mask(cpl_frame *frame, cpl_frame *edges, xsh_instrument *instr)
cpl_frame * xsh_create_master_flat(cpl_frame *frame, xsh_instrument *instr)
cpl_frame * xsh_create_master_bias2(cpl_frameset *rawFrames, xsh_stack_param *stack_par, xsh_instrument *instr, const char *result_name, const int method_code)
Creates master bias.
cpl_frame * xsh_create_master_dark(cpl_frame *bpMap, xsh_instrument *instr, cpl_parameterlist *parameters, cpl_frame *crh_frm, cpl_frame *bp_map_frm)
cpl_frame * xsh_create_master_dark_bpmap(cpl_frame *frame, xsh_instrument *instr)
cpl_frame * xsh_create_master_dark2(cpl_frameset *raws, xsh_stack_param *stack_param, cpl_parameterlist *drs_param, cpl_propertylist *qc_log, xsh_instrument *instr)
cpl_frame * xsh_detect_order_edge(cpl_frame *frame, cpl_frame *order_table, xsh_detect_order_param *det_param, xsh_instrument *instr)
Detect order edges and compute polynomial description of ordermin and order max.
static double exptime
static char mode[32]
static xsh_instrument * instrument
static xsh_clipping_param crh_clipping
cpl_frame * xsh_calibrate_flux(cpl_frame *spectrum_frame, cpl_frame *respon_frame, cpl_frame *atmos_ext_frame, const char *fname, xsh_instrument *instrument)
cpl_frame * xsh_combine_nod(cpl_frameset *frames, xsh_combine_nod_param *param, const char *fname, xsh_instrument *instrument, cpl_frame **res_frame_ext, const int scale_nod)
cpl_frame * xsh_compute_linearity(cpl_frameset *, xsh_instrument *, xsh_clipping_param *, const int decode_bp)
int xsh_linear_group_by_exptime(cpl_frameset *, xsh_instrument *, double, cpl_frameset **)
cpl_frame * xsh_compute_noise_map(cpl_imagelist *, cpl_frame *bpmap, xsh_clipping_param *, xsh_instrument *instr, cpl_frame **noisemap)
cpl_frameset * xsh_compute_shift_ifu(double lambda_ref, double lambdaref_hsize, cpl_frameset *objpos_frameset, cpl_frameset *shiftifu_frameset, xsh_instrument *instr, const char *prefix)
Compute the shift in slit between reference wavelength and others for all the slitlets.
cpl_frame * xsh_compute_shift_ifu_slitlet(double lambda_ref, cpl_frame *objpos_frame, cpl_frame *shiftifu_frame, double lambdaref_hsize, const char *resname)
Compute the shift in slit between reference wavelength and others.
cpl_frame * xsh_compute_slice_dist(cpl_frameset *loc_frame_set, cpl_frame *order_tab, cpl_frame *slitmap_frame, cpl_frameset *merge_frameset, double lambda, xsh_instrument *instrument)
cpl_frame * xsh_compute_absorp(cpl_frame *s1d_frame, cpl_frame *telllist_frame, int filter_hsize, double threshold, xsh_instrument *instr)
Compute the shift in slit between reference wavelength and others for all the slitlets.
void xsh_mark_tell(cpl_frame *s1d_frame, cpl_frame *tellmask_frame)
Mark telluric in spectrum.
void xsh_data_check_spectralformat(cpl_frame *spectralformat_frame, cpl_frame *orderlist_frame, cpl_frame *wavesol_frame, cpl_frame *model_config, xsh_instrument *instr)
Check the borders of wavelength foreach orders in spectral format.
void xsh_detect_arclines_dan(cpl_frame *frame, cpl_frame *theo_tab_frame, cpl_frame *arc_lines_tab_frame, cpl_frame *wave_tab_guess_frame, cpl_frame *order_tab_recov_frame, cpl_frame *config_model_frame, cpl_frame *spectralformat_frame, cpl_frame **resid_tab_orders_frame, cpl_frame **arc_lines_clean_tab_frame, cpl_frame **wave_tab_frame, cpl_frame **resid_tab_frame, xsh_sol_wavelength type, xsh_detect_arclines_param *da, xsh_clipping_param *dac, xsh_instrument *instr, const char *rec_id, const int clean_tmp, const int resid_tab_name_sw)
detect the position on the detector of emission lines listed in a catalogue, from expected position v...
void xsh_detect_arclines(cpl_frame *frame, cpl_frame *theo_tab_frame, cpl_frame *arc_lines_tab_frame, cpl_frame *wave_tab_guess_frame, cpl_frame *order_tab_recov_frame, cpl_frame *config_model_frame, cpl_frame *spectralformat_frame, cpl_frame **resid_tab_orders_frame, cpl_frame **arc_lines_clean_tab_frame, cpl_frame **wave_tab_frame, cpl_frame **resid_tab_frame, xsh_sol_wavelength type, xsh_detect_arclines_param *da, xsh_clipping_param *dac, xsh_instrument *instr, const char *rec_id, const int clean_tmp, const int resid_tab_name_sw)
detect the position on the detector of emission lines listed in a catalogue, from expected position v...
cpl_frame * xsh_detect_continuum(cpl_frame *frame, cpl_frame *order_table, cpl_frame *spectral_format, xsh_detect_continuum_param *param, xsh_clipping_param *dcn_clipping, xsh_instrument *instr, cpl_frame **resid_frame)
Detect order and compute polynomial description of ordermin and order max. Uses a guess order table i...
cpl_frame * xsh_order_table_from_fmtchk(xsh_pre *pre, cpl_frame *spectral_frame, xsh_detect_continuum_param *detect_param, xsh_instrument *instrument)
cpl_frame * xsh_divide_flat(cpl_frame *frame, cpl_frame *flat, const char *filename, xsh_instrument *instr)
divide PRE frame with the master FLAT frame
Definition: xsh_divide.c:75
cpl_frame * xsh_preframe_extract(cpl_frame *frame, int xmin, int ymin, int xmax, int ymax, const char *name, xsh_instrument *instr)
This function create a sub frame from PRE frame. the sub frame is described by a box.
Definition: xsh_prepare.c:221
cpl_frame * xsh_bpmap_2pre(cpl_frame *bpmap, const char *prefix, xsh_instrument *inst)
This function transform a BP map from raw to pre format.
Definition: xsh_prepare.c:81
void xsh_prepare(cpl_frameset *frames, cpl_frame *bpmap, cpl_frame *mbias, const char *prefix, xsh_instrument *instr, const int pre_overscan_corr, const bool flag_neg_and_thresh_pix)
This function transform RAW frames dataset in PRE frames dataset attaching the default bad pixel map ...
Definition: xsh_prepare.c:122
cpl_frame * xsh_extract(cpl_frame *rec_frame, cpl_frame *loc_frame, xsh_instrument *instrument, xsh_extract_param *extract_par, cpl_frame **res_frame_ext, const char *rec_prefix)
simple 1D extraction of point source like object
Definition: xsh_extract.c:808
cpl_error_code xsh_extract_clean_slice(const float *flux, const float *errs, int *qual, const double *lambda, const int ilambda, xsh_instrument *instrument, const int slit_min, const int slit_max, const int nlambda, const int nslit, const int mask_hsize, double *fluxval, double *errval, int *qualval, float *, float *, float *)
Definition: xsh_extract.c:346
cpl_frame * xsh_cube(cpl_frameset *merge2d_frameset, xsh_instrument *instrument, const char *rec_prefix)
Create a cube.
Definition: xsh_format.c:472
cpl_frame * xsh_extract_clean(cpl_frame *rec_frame, cpl_frame *loc_frame, xsh_instrument *instrument, xsh_extract_param *extract_par, xsh_interpolate_bp_param *ipol_bp, cpl_frame **res_frame_ext, const char *rec_prefix)
simple 1D extraction of point source like object
Definition: xsh_extract.c:836
cpl_frame * xsh_format(cpl_frameset *rect_frame_set, const char *result_name, xsh_instrument *instrument, const char *rec_prefix)
Definition: xsh_format.c:152
cpl_frameset * xsh_extract_ifu(cpl_frameset *rec_frame_set, cpl_frameset *loc_frame_set, xsh_instrument *instrument, xsh_extract_param *extract_par, const char *rec_prefix)
Loop on IFU Frames to extract simple 1D (1 per slitlet)
Definition: xsh_extract.c:868
void xsh_center_cube(cpl_frame *cube_frame, cpl_frame *sky_line_frame, int chunk_size, xsh_instrument *instrument)
Shift a cube to center object at 0 arcsec.
Definition: xsh_format.c:343
cpl_frame * xsh_flat_merge_qth_d2_tabs(cpl_frame *qth_edges_tab, cpl_frame *d2_edges_tab, xsh_instrument *instrument)
Merge two order edges tables according the spectral format.
void xsh_flat_merge_qth_d2(cpl_frame *qth_frame, cpl_frame *qth_order_tab_frame, cpl_frame *d2_frame, cpl_frame *d2_order_tab_frame, cpl_frame *qth_bkg_frame, cpl_frame *d2_bkg_frame, cpl_frame **qth_d2_flat_frame, cpl_frame **qth_d2_bkg_frame, cpl_frame **qth_d2_order_tab_frame, xsh_instrument *instrument)
Merge two master flat fields and order tables according the spectral format.
void xsh_flat_merge_qth_d2_smooth(cpl_frame *qth_frame, cpl_frame *qth_order_tab_frame, cpl_frame *d2_frame, cpl_frame *d2_order_tab_frame, cpl_frame *qth_bkg_frame, cpl_frame *d2_bkg_frame, cpl_frame **qth_d2_flat_frame, cpl_frame **qth_d2_bkg_frame, cpl_frame **qth_d2_order_tab_frame, xsh_instrument *instrument)
Merge two master flat fields and order tables according the spectral format.
cpl_frame * xsh_afcthetab_create(cpl_frame *wave_tab_frame, cpl_frame *model_config_frame, int order, cpl_frame *spectralformat_frame, cpl_frame *arclines_frame, int xmin, int ymin, xsh_instrument *instr, const int clean_tmp)
Create a The tab for AFC.
Definition: xsh_flexcor.c:363
cpl_frame * xsh_flexcor(cpl_frame *afc_frame, cpl_frame *wave_tab_frame, cpl_frame *model_config_frame, cpl_frame *order_tab_frame, cpl_frame *attresidtab_frame, int afc_xmin, int afc_ymin, xsh_instrument *instr, cpl_frame **afc_order_tab_frame, cpl_frame **afc_model_config_frame)
This function applies the computed shift betwwen AFC CAL and AFC ATT frame.
Definition: xsh_flexcor.c:91
void xsh_follow_arclines_slit(cpl_frame *inframe, cpl_frame *arclines, cpl_frame *wavesol, cpl_frame *order_table, cpl_frame *spectralformat_frame, cpl_frame *model_config_frame, cpl_frame *wavemap_frame, cpl_frame *slitmap_frame, cpl_frame *disptab_frame, xsh_follow_arclines_param *param, xsh_instrument *instrument, cpl_frame **tilt_list, cpl_frame **shift_frame)
void xsh_follow_arclines_ifu(cpl_frame *inframe, cpl_frame *arclines, cpl_frame *wavesol, cpl_frame *order_table, cpl_frame *spectralformat_frame, cpl_frame *model_config_frame, cpl_frame *wavemap_frame, cpl_frame *slitmap_frame, cpl_frame *disptab_frame, xsh_follow_arclines_param *follow_param, xsh_instrument *instrument, cpl_frameset *tilt_set, cpl_frame **shift_frame)
Detect and follow arc lines. Computes center, width and tilt parameters. The position of the center o...
cpl_frameset * xsh_ifu_wavetab_create(cpl_frame *wave_tab_frame, cpl_frame *shift_tab_frame, xsh_instrument *instr)
Create an IFU wave tab frame set.
Definition: xsh_ifu.c:71
double xsh_convert_seeing(cpl_frame *frame)
Convert seeing keywork in mu sigma.
cpl_frameset * xsh_localize_ifu(cpl_frameset *merge2d_frameset, cpl_frame *skymask_frame, xsh_localize_ifu_param *locifu_par, xsh_instrument *instrument, const char *resname)
Localize center of object on a merge 2D IFU slitlet.
cpl_frame * xsh_localize_ifu_slitlet(cpl_frame *merge2d_slitlet, cpl_frame *skymask_frame, int smooth_hsize, int nscales, int HF_skip, const char *resname, double cut_sigma_low, double cut_sigma_up, double cut_snr_low, double cut_snr_up, double slit_min, double slit_max, int deg, int box_hsize, xsh_instrument *instr)
Localize center of object on a merge 2D IFU slitlet.
cpl_frame * xsh_localize_obj(cpl_frame *sci_frame, cpl_frame *skymask_frame, xsh_instrument *instrument, xsh_localize_obj_param *loc_obj_par, xsh_slit_limit_param *slit_limit_param, const char *fname)
Build the localization table.
cpl_frameset * xsh_localize_obj_ifu(cpl_frameset *sci_frame, cpl_frame *skymask_frame, xsh_instrument *instrument, xsh_localize_obj_param *loc_obj_par, xsh_slit_limit_param *slit_limit_param)
cpl_frameset * xsh_merge_ord_ifu(cpl_frameset *rec_frameset, xsh_instrument *instrument, int merge_par, const char *rec_prefix)
Merge orders of the rectified frame using merge parameters.
cpl_frame * xsh_merge_ord(cpl_frame *sci_frame, xsh_instrument *instrument, int merge, const char *rec_prefix)
Merge orders of the rectified frame using merge parameters.
cpl_frame * xsh_merge_ord_slitlet(cpl_frame *rec_frame, xsh_instrument *instrument, int merge_par, int slitlet, const char *rec_prefix)
Merge orders of the rectified frame using merge parameters.
cpl_frame * xsh_multiply_flat(cpl_frame *frame, cpl_frame *flat, const char *filename, xsh_instrument *instr)
multiply PRE frame with the master FLAT frame
Definition: xsh_multiply.c:77
void xsh_opt_extract(cpl_frame *sci_frame, cpl_frame *order_table_frame, cpl_frame *wavesol_frame, cpl_frame *model_frame, cpl_frame *wavemap_frame, cpl_frame *slitmap_frame, cpl_frame *loc_frame, cpl_frame *spectralformat_frame, cpl_frame *masterflat_frame, xsh_instrument *instrument, xsh_opt_extract_param *opt_extract_par, const char *rec_prefix, cpl_frame **orderext1d_frame, cpl_frame **orderoxt1d_frame, cpl_frame **orderoxt1d_eso_frame, cpl_frame **qc_subextract_frame, cpl_frame **qc_s2ddiv1d_frame, cpl_frame **qc_model_frame, cpl_frame **qc_weight_frame)
Create a SPECTRUM 1D from a Science frame.
void xsh_opt_extract_orders(cpl_frame *sci_frame, cpl_frame *orderlist_frame, cpl_frame *wavesol_frame, cpl_frame *model_frame, cpl_frame *wavemap_frame, cpl_frame *slitmap_frame, cpl_frame *loc_frame, cpl_frame *spectralformat_frame, cpl_frame *masterflat_frame, xsh_instrument *instrument, xsh_opt_extract_param *opt_extract_par, int min_index, int max_index, const char *rec_refix, cpl_frame **orderext1d_frame, cpl_frame **orderoxt1d_frame, cpl_frame **orderoxt1d_eso_frame, cpl_frame **qc_subextract_frame, cpl_frame **qc_s2ddiv1d_frame, cpl_frame **qc_model_frame, cpl_frame **qc_weight_frame)
Create a SPECTRUM 1D from a Science frame.
cpl_frame * xsh_rectify_and_shift(cpl_frame *sci_frame, cpl_frame *orderlist_frame, cpl_frame *wavesol_frame, cpl_frame *model_frame, xsh_instrument *instrument, xsh_rectify_param *rectify_par, cpl_frame *spectralformat_frame, cpl_frame *loc_frame, cpl_frame *loc0_frame, double *throw_shift, cpl_frame *disp_tab_frame, const char *res_name, cpl_frame **res_frame_ext, cpl_frame **res_frame_tab)
Definition: xsh_rectify.c:928
cpl_frameset * xsh_rectify_orders_ifu(cpl_frame *sci_frame, xsh_order_list *orderlist, cpl_frameset *wavesol_frameset, cpl_frameset *shift_frameset, cpl_frame *model_frame, xsh_instrument *instrument, xsh_rectify_param *rectify_par, cpl_frame *spectralformat_frame, cpl_frame *slitmap_frame, cpl_frameset **rec_frameset_ext, cpl_frameset **rec_frameset_tab, int min_index, int max_index, const char *rec_prefix)
Definition: xsh_rectify.c:1514
cpl_frame * shift_with_kw(cpl_frame *rec_frame, xsh_instrument *instrument, xsh_rectify_param *rectify_par, const char *fname, cpl_frame **res_frame_ext, double **ref_ra, double **ref_dec, int flag)
This function creates a structure containing for each order the shift to be applied.
Definition: xsh_rectify.c:1974
cpl_frame * xsh_rectify_orders(cpl_frame *sci_frame, xsh_order_list *orderlist_frame, cpl_frame *wavesol_frame, cpl_frame *model_frame, xsh_instrument *instrument, xsh_rectify_param *rectify_par, cpl_frame *spectralformat_frame, cpl_frame *disp_tab_frame, const char *res_name, const char *tag, cpl_frame **res_frame_ext, cpl_frame **res_frame_tab, int min_index, int max_index, double slit_min, int nslit, double slit_shift, cpl_frame *slitshift_tab)
Create a grid in wavelength with the step in lambda and slit. Steps are defined in the parameters....
Definition: xsh_rectify.c:1079
void xsh_compute_slitlet_limits(cpl_frameset *shift_set, double sdown, double sldown, double slup, double sup, double slit_bin, double *slitmin_tab, int *nslit_tab, double *slitcen_tab)
Definition: xsh_rectify.c:1372
void xsh_get_slit_edges(cpl_frame *slitmap_frame, double *sdown, double *sup, double *sldown, double *slup, xsh_instrument *instrument)
Trace slit edges in a master flat.
Definition: xsh_rectify.c:671
void xsh_rec_slit_size(xsh_rectify_param *rectify_par, double *slit_min, int *nslit, XSH_MODE mode)
rectify frame
Definition: xsh_rectify.c:758
cpl_frame * xsh_rectify(cpl_frame *sci_frame, cpl_frame *order_table_frame, cpl_frame *wavesol_frame, cpl_frame *model_config_frame, xsh_instrument *instrument, xsh_rectify_param *rectify_par, cpl_frame *spectral_format, cpl_frame *disp_tab_frame, const char *fname, cpl_frame **res_frame_ext, cpl_frame **res_frame_tab, const char *prefix)
Create a grid in wavelength with the step in lambda and slit. Steps are defined in the parameters....
Definition: xsh_rectify.c:867
cpl_frameset * xsh_rectify_ifu(cpl_frame *sci_frame, cpl_frame *order_table_frame, cpl_frameset *wavesol_frame_set, cpl_frameset *shiftifu_frameset, cpl_frame *model_config_frame, xsh_instrument *instrument, xsh_rectify_param *rectify_par, cpl_frame *spectral_format, cpl_frame *slitmap_frame, cpl_frameset **rec_frameset_ext, cpl_frameset **rec_frameset_tab, const char *rec_prefix)
Definition: xsh_rectify.c:1014
cpl_frame * xsh_shift_rectified(cpl_frame *rec_frame, cpl_frame *loc_frame, cpl_frame *loc0_frame, const char *file_name, xsh_combine_nod_param *combine_nod_param, xsh_rectify_param *rectif_par, xsh_instrument *instrument, cpl_frame **res_frame_ext)
Definition: xsh_rectify.c:2108
cpl_frame * xsh_combine_offset(cpl_frameset *rawFrames, const char *result_name, xsh_stack_param *stack_par, xsh_instrument *instr, cpl_imagelist **list, cpl_image **crh_ima, const int save_tmp)
cpl_frame * xsh_remove_crh_multiple(cpl_frameset *rawFrames, const char *name, xsh_stack_param *stack_param, xsh_clipping_param *crh_clipping, xsh_instrument *inst, cpl_imagelist **, cpl_image **, const int save_tmp)
cpl_frame * xsh_abs_remove_crh_single(cpl_frame *sci_frame, xsh_instrument *instrument, xsh_remove_crh_single_param *single_par, const char *res_tag)
cpl_frame * xsh_remove_crh_single(cpl_frame *sci_frame, xsh_instrument *instrument, cpl_mask *sky_map, xsh_remove_crh_single_param *single_par, const char *name)
Remove cosmic rays from a single frame.
cpl_frameset * xsh_subtract_sky_nod(cpl_frameset *raws, xsh_instrument *instrument, int mode_fast)
cpl_frameset * xsh_subtract_sky_offset(cpl_frameset *object_raws, cpl_frameset *sky_raws, int nraws, xsh_instrument *instrument)
cpl_frame * xsh_add_sky_model(cpl_frame *sub_sky_frame, cpl_frame *sky_frame, xsh_instrument *instrument, const char *rec_prefix)
cpl_frame * xsh_subtract_sky_single(cpl_frame *sci_frame, cpl_frame *order_table_frame, cpl_frame *slitmap_frame, cpl_frame *wavemap_frame, cpl_frame *locTable_frame, cpl_frame *ref_sky_list, cpl_frame *sky_orders_chunks, cpl_frame *usr_defined_break_points_frame, xsh_instrument *instrument, int nbkpts, xsh_subtract_sky_single_param *sky_par, cpl_frame **sky_spectrum, cpl_frame **sky_spectrum_eso, const char *rec_prefix, const int clean_tmp)
Subtract the sky background for single frame. If sky_spectrum is NOT NULL it is saved as a product,...
cpl_frame * xsh_subtract_background(cpl_frame *frame, cpl_frame *ordertable, xsh_background_param *bckg, xsh_instrument *instr, const char *prefix, cpl_frame **grid_frame, cpl_frame **frame_backg, const int save_bkg, const int save_grid, const int save_sub_bkg)
Subtract the inter-order background from PRE frame.
Definition: xsh_subtract.c:947
cpl_frameset * xsh_subtract_nir_on_off(cpl_frameset *on, cpl_frameset *off, xsh_instrument *instr)
(NIR only) subtract the OFF set of files from the On set of files
Definition: xsh_subtract.c:194
cpl_frame * xsh_subtract_bias(cpl_frame *frame, cpl_frame *bias, xsh_instrument *instr, const char *type, const int pre_overscan_corr, const int save_tmp)
Subtract the master bias frame from PRE frame.
Definition: xsh_subtract.c:120
cpl_frame * xsh_subtract_dark(cpl_frame *frame, cpl_frame *dark, const char *filename, xsh_instrument *instr)
subtract the master dark frame from PRE frame
Definition: xsh_subtract.c:247
int threshold
Definition: xsh_detmon_lg.c:90
int order
Definition: xsh_detmon_lg.c:80
cpl_frame * xsh_create_poly_wavemap(cpl_frame *pre_frame, cpl_frame *wave_tab_2d_frame, cpl_frame *order_tab_frame, cpl_frame *spectral_format_frame, xsh_dispersol_param *dispsol_par, xsh_instrument *instrument, const char *filename, cpl_frame **dispersol_frame, cpl_frame **slitmap_frame)
cpl_error_code xsh_wavetab_qc(cpl_frame *frm_tab, const int is_poly)
Monitor min/max/med/avg distance between detected lines on each ordee.
cpl_frame * xsh_compute_response_ord(cpl_frame *rect_frame, cpl_frame *std_star_flux_frame, cpl_frame *atmos_ext_frame, cpl_frame *high_abs_tab_frame, xsh_instrument *instrument, double exptime)
cpl_frame * xsh_compute_response(cpl_frame *rect_frame, cpl_frame *std_star_flux_frame, cpl_frame *atmos_ext_frame, cpl_frame *high_abs_tab_frame, xsh_instrument *instrument, double exptime)
void xsh_create_model_map(cpl_frame *model_frame, xsh_instrument *instrument, const char *wave_map_tag, const char *slit_map_tag, cpl_frame **wavemap_frame, cpl_frame **slitmap_frame, const int save_tmp)
void xsh_compute_slitlet_center(xsh_order_list *order_list, cpl_frame *slitmap_frame, double *down, double *cen, double *up, XSH_ARM arm)
xsh_sol_wavelength
Definition: xsh_drl.h:231
@ XSH_SOLUTION_ABSOLUTE
Definition: xsh_drl.h:232
@ XSH_SOLUTION_RELATIVE
Definition: xsh_drl.h:233
cpl_frame * xsh_create_order_table(cpl_frame *in_frame, cpl_frame *spectralformat_frame, cpl_frame *resid_frame, cpl_frame *arclines, xsh_detect_arclines_param *da, xsh_clipping_param *dac, xsh_instrument *instrument)
cpl_frame * xsh_create_dispersol_physmod(cpl_frame *pre_frame, cpl_frame *order_tab_frame, cpl_frame *mod_cfg_frame, cpl_frame *wave_map_frame, cpl_frame *slit_map_frame, xsh_dispersol_param *dispsol_param, cpl_frame *spectral_format_frame, xsh_instrument *instrument, const int clean_tmp)
cpl_frame * xsh_compute_response2(cpl_frame *rect_frame, cpl_frame *std_star_flux_frame, cpl_frame *atmos_ext_frame, cpl_frame *high_abs_tab_frame, cpl_frame *resp_fit_points, cpl_frame *tell_mod_cat_frame, xsh_instrument *instrument, double exptime, const int tell_corr)
cpl_frame * xsh_create_wavemap(cpl_frame *in_frame, cpl_frame *resid_frame, cpl_frame *order_frame, xsh_dispersol_param *dispersol_param, xsh_instrument *instrument)
cpl_error_code xsh_wavemap_qc(cpl_frame *frm_map, const cpl_frame *frm_tab)
Monitor Flux level along the orders traces given by an input table.
void xsh_create_map(cpl_frame *dispsol_frame, cpl_frame *ordertab_frame, cpl_frame *pre_frame, xsh_instrument *instrument, cpl_frame **wavemap_frame, cpl_frame **slitmap_frame, const char *rec_prefix)