X-shooter Pipeline Reference Manual 3.8.15
xsh_geom_ifu.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-02-04 12:44:48 $
23 * $Revision: 1.63 $
24 *
25*/
26
27#ifdef HAVE_CONFIG_H
28#include <config.h>
29#endif
30
31/*----------------------------------------------------------------------------*/
39/*----------------------------------------------------------------------------*/
42/*-----------------------------------------------------------------------------
43 Includes
44 ----------------------------------------------------------------------------*/
45
46
47/* DRL steps */
48
49/* Error handling */
50#include <xsh_error.h>
51/* Utility fonctions */
52#include <xsh_utils.h>
53#include <xsh_msg.h>
54/* DFS functions */
55#include <xsh_dfs.h>
56#include <xsh_pfits.h>
57/* DRL functions */
58#include <xsh_drl.h>
59#include <xsh_drl_check.h>
60#include <xsh_utils_table.h>
61#include <xsh_model_utils.h>
62#include <xsh_utils_image.h>
63#include <xsh_utils_ifu.h>
64#include <xsh_blaze.h>
65#include <xsh_parameters.h>
67/* Library */
68#include <cpl.h>
69/* CRH Remove */
70
71/*-----------------------------------------------------------------------------
72 Defines
73 ----------------------------------------------------------------------------*/
74
75#define RECIPE_ID "xsh_geom_ifu"
76#define RECIPE_AUTHOR "P.Goldoni, L.Guglielmi, R. Haigron, F. Royer"
77#define RECIPE_CONTACT "regis.haigron@obspm.fr"
78
79#define XSH_GEOM_SLIT_BIN_SIZE_PIPE_UVB 0.16
80#define XSH_GEOM_SLIT_BIN_SIZE_PIPE_VIS 0.16
81#define XSH_GEOM_SLIT_BIN_SIZE_PIPE_NIR 0.2
82#define XSH_GEOM_WAVE_BIN_SIZE_PIPE_UVB 0.04
83#define XSH_GEOM_WAVE_BIN_SIZE_PIPE_VIS 0.04
84#define XSH_GEOM_WAVE_BIN_SIZE_PIPE_NIR 0.1
85/*-----------------------------------------------------------------------------
86 Functions prototypes
87 ----------------------------------------------------------------------------*/
88
89/*
90 * Plugin initalization, execute and cleanup handlers
91 */
92static cpl_error_code
93xsh_rectify_params_set_defaults_drl(cpl_parameterlist* pars,
94 const char* rec_id,
95 xsh_instrument* inst,
96 xsh_rectify_param * rectify_par);
97
98static int xsh_geom_ifu_create(cpl_plugin *);
99static int xsh_geom_ifu_exec(cpl_plugin *);
100static int xsh_geom_ifu_destroy(cpl_plugin *);
101
102/* The actual executor function */
103static void xsh_geom_ifu(cpl_parameterlist *, cpl_frameset *);
104
105/*-----------------------------------------------------------------------------
106 Static variables
107 ----------------------------------------------------------------------------*/
109"Produces the spatial geometry of the IFU pattern on the sky";
110
112"This recipe Produces the spatial geometry of the IFU pattern on the sky\n\
113Input Frames : \n\
114 - A set of n science frames ( n == 1 or >=3, Tag = TRACE_arm)\n\
115 - [UVB,VIS] A master bias frame (Tag = MASTER_BIAS_arm)\n\
116 - [OPTIONAL] A master dark frame (Tag = MASTER_DARK_arm)\n\
117 - A master flat frame (Tag = MASTER_FLAT_IFU_arm)\n\
118 - An AFC corrected model order edges table for IFU frame (Tag = ORDER_TAB_AFC_IFU_arm)\n\
119 - [PHYSMOD] An AFC corrected model cfg frame (Tag = XSH_MOD_CFG_OPT_AFC_arm)\n\
120 - [POLY] An AFC corrected model wavesol frame (Tag = WAVE_TAB_AFC_arm)\n\
121 - An AFC corrected dispersion solution frame (Tag = DISP_TAB_AFC_arm)\n\
122 - [OPTIONAL] A badpixel map (Tag = BADPIXEL_MAP_arm)\n\
123Products : \n\
124 - A set of shift offset tables (Tag = OFFSET_TAB_slitlet_IFU_arm)\n" ;
125
126/*-----------------------------------------------------------------------------
127 Functions code
128 ----------------------------------------------------------------------------*/
129/*----------------------------------------------------------------------------*/
138/*----------------------------------------------------------------------------*/
139
140int cpl_plugin_get_info(cpl_pluginlist *list) {
141 cpl_recipe *recipe = NULL;
142 cpl_plugin *plugin = NULL;
143
144 recipe = cpl_calloc(1, sizeof(*recipe));
145 if ( recipe == NULL ){
146 return -1;
147 }
148
149 plugin = &recipe->interface ;
150
151 cpl_plugin_init(plugin,
152 CPL_PLUGIN_API, /* Plugin API */
153 XSH_BINARY_VERSION, /* Plugin version */
154 CPL_PLUGIN_TYPE_RECIPE, /* Plugin type */
155 RECIPE_ID, /* Plugin name */
156 xsh_geom_ifu_description_short, /* Short help */
157 xsh_geom_ifu_description, /* Detailed help */
158 RECIPE_AUTHOR, /* Author name */
159 RECIPE_CONTACT, /* Contact address */
160 xsh_get_license(), /* Copyright */
164
165 cpl_pluginlist_append(list, plugin);
166
167 return (cpl_error_get_code() != CPL_ERROR_NONE);
168}
169
170/*----------------------------------------------------------------------------*/
180/*----------------------------------------------------------------------------*/
181
182static int xsh_geom_ifu_create(cpl_plugin *plugin){
183 cpl_recipe *recipe = NULL;
184 cpl_parameter* p =NULL;
185 char paramname[256];
186 char recipename[256];
187 xsh_clipping_param crh_clip_param = {5.0, 5, 0.7, 0, 0.3};
188 /* First param (conv_kernel) should be initialized correctly ! */
189 xsh_remove_crh_single_param crh_single = { 0.1, 5, 2.0, 4} ;
190 xsh_rectify_param rectify = { "tanh",
191 CPL_KERNEL_DEFAULT, 4,
192 -1,
193 -1,
194 1, 0, 0};
195 xsh_localize_ifu_param loc_ifu =
196 { 3, 5, 2, 0.05, 0.95, 0.05, 0.95, 0.0, 0.0, 0, FALSE, 50};
197
198 xsh_stack_param stack_param = {"median",5.,5.};
199
200 /* Reset library state */
201 xsh_init();
202
203 /* Check input */
204 assure( plugin != NULL, CPL_ERROR_NULL_INPUT, "Null plugin");
205
206 /* Get the recipe out of the plugin */
207 assure( cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE,
208 CPL_ERROR_TYPE_MISMATCH,
209 "Plugin is not a recipe");
210
211 recipe = (cpl_recipe *)plugin;
212
213 /* Create the parameter list in the cpl_recipe object */
214 recipe->parameters = cpl_parameterlist_new();
215 assure( recipe->parameters != NULL,
216 CPL_ERROR_ILLEGAL_OUTPUT,
217 "Memory allocation failed!");
218
219 /* Set generic parameters (common to all recipes) */
220 check( xsh_parameters_generic( RECIPE_ID, recipe->parameters ) ) ;
221 xsh_parameters_decode_bp(RECIPE_ID,recipe->parameters,-1);
222 check( xsh_parameters_pre_overscan( RECIPE_ID, recipe->parameters ) ) ;
223 check(xsh_parameters_stack_create(RECIPE_ID,recipe->parameters,stack_param));
224 /* crh clipping params */
226 crh_clip_param));
227
228 /* subtract_background_params */
230
231 /* remove_crh_single */
233 crh_single )) ;
234
235 /* xsh_rectify */
237 rectify )) ;
238
239 /* localize_ifu */
241 loc_ifu)) ;
242 /* correct ifu */
243 check( xsh_parameters_new_int( recipe->parameters, RECIPE_ID,
244 "correctifu-niter", 3,
245 "Number of iterations in computing the localization shifts of the IFU slitlets"));
246 check( xsh_parameters_new_double( recipe->parameters, RECIPE_ID,
247 "correctifu-lambdaref", -1,
248 "Reference wavelength where the reference localization on the slit is chosen"));
249 check( xsh_parameters_new_double( recipe->parameters, RECIPE_ID,
250 "correctifu-lambdaref-hsize", 2.5,
251 "HAlf size in nm to estimate reference wavelength"));
252
253 check( xsh_parameters_new_boolean( recipe->parameters, RECIPE_ID,
254 "do-cube", FALSE,
255 "if TRUE creates a data cube"));
256
257 check( xsh_parameters_new_boolean( recipe->parameters, RECIPE_ID,
258 "compute-map", TRUE,
259 "if TRUE recompute (wave and slit) maps from the dispersion solution."));
260
261 check( xsh_parameters_new_boolean( recipe->parameters, RECIPE_ID,
262 "check-afc", TRUE,
263 "Input AFC corrected model/wave solution and science frame check."\
264 "If TRUE the recipe verify that the input mode/wave solution is AFC corrected,"\
265 " its INS.OPTIi.NAME is 'Pin_0.5 ', and its OBS.ID and OBS.TARG.NAME values"\
266 " matches with the corresponding values of the science frame."));
267
268 sprintf(recipename,"xsh.%s",RECIPE_ID);
269 sprintf(paramname,"%s.%s",recipename,"flat-method");
270 check( p = cpl_parameter_new_enum( paramname,CPL_TYPE_STRING,
271 "method adopted for flat:",
272 recipename,"blaze",
273 2,"master","blaze"));
274
275 check(cpl_parameter_set_alias( p,CPL_PARAMETER_MODE_CLI,
276 "flat-method"));
277 check(cpl_parameterlist_append( recipe->parameters, p));
278
279 cleanup:
280 if ( cpl_error_get_code() != CPL_ERROR_NONE ){
281 xsh_error_dump(CPL_MSG_ERROR);
282 return 1;
283 }
284 else {
285 return 0;
286 }
287}
288/*--------------------------------------------------------------------------*/
296/*--------------------------------------------------------------------------*/
297
298static cpl_error_code
299xsh_params_bin_scale(cpl_frameset* raws,
301{
302
303 cpl_frame* frame=NULL;
304 const char* name=NULL;
305 cpl_propertylist* plist=NULL;
306 int binx=0;
307 int biny=0;
308
309 check(frame=cpl_frameset_get_frame(raws,0));
310 check(name=cpl_frame_get_filename(frame));
311 check(plist=cpl_propertylist_load(name,0));
314 xsh_free_propertylist(&plist);
315
316 if(biny>1) {
317
318 /*
319 backg->sampley=backg->sampley/biny;
320 Not bin dependent.
321 */
322
323 backg->radius_y=backg->radius_y/biny;
324
325
326 /*
327 rectify_par->rectif_radius=rectify_par->rectif_radius/biny;
328 Rectify Interpolation radius.
329 For the moment not bin dependent, but for optimal results probably yes
330 */
331
332 /*
333 rectify_par->rectif_bin_lambda=rectify_par->rectif_bin_lambda/biny;
334 Rectify Wavelength Step.
335 For the moment not bin dependent, but for optimal results probably yes
336 */
337
338 /*
339 loc_obj_par->loc_chunk_nb=loc_obj_par->loc_chunk_nb/biny;
340 Localization Nb of chunks.
341 Not bin dependent
342 */
343 }
344
345
346 if(binx>1) {
347
348 backg->radius_x=backg->radius_x/binx;
349
350
351 /*
352 rectify_par->rectif_bin_space=rectify_par->rectif_bin_space/binx;
353 Rectify Position Step.
354 For the moment not bin dependent, but for optimal results probably yes
355 */
356
357 }
358
359 cleanup:
360 xsh_free_propertylist(&plist);
361 return cpl_error_get_code();
362
363}
364
365/*----------------------------------------------------------------------------*/
371/*----------------------------------------------------------------------------*/
372
373static int xsh_geom_ifu_exec(cpl_plugin *plugin) {
374 cpl_recipe *recipe = NULL;
375
376 /* Check parameter */
377
378 assure( plugin != NULL, CPL_ERROR_NULL_INPUT, "Null plugin" );
379
380 /* Get the recipe out of the plugin */
381 assure( cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE,
382 CPL_ERROR_TYPE_MISMATCH, "Plugin is not a recipe");
383
384 recipe = (cpl_recipe *)plugin;
385
386 /* Check recipe */
387 xsh_geom_ifu(recipe->parameters, recipe->frames);
388
389 cleanup:
390 if ( cpl_error_get_code() != CPL_ERROR_NONE ) {
391 xsh_error_dump(CPL_MSG_ERROR);
393 return 1;
394 }
395 else {
396 return 0;
397 }
398}
399
400/*----------------------------------------------------------------------------*/
406/*----------------------------------------------------------------------------*/
407static int xsh_geom_ifu_destroy(cpl_plugin *plugin)
408{
409 cpl_recipe *recipe = NULL;
410
411 /* reset error state before detroying recipe */
413 /* Check parameter */
414 assure( plugin != NULL, CPL_ERROR_NULL_INPUT, "Null plugin" );
415
416 /* Get the recipe out of the plugin */
417 assure( cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE,
418 CPL_ERROR_TYPE_MISMATCH, "Plugin is not a recipe");
419
420 recipe = (cpl_recipe *)plugin;
421
422 xsh_free_parameterlist(&recipe->parameters);
423
424 cleanup:
425 if (cpl_error_get_code() != CPL_ERROR_NONE)
426 {
427 return 1;
428 }
429 else
430 {
431 return 0;
432 }
433}
434
435static cpl_error_code
437 xsh_rectify_param * rectify_par)
438{
439
440
441 xsh_msg_dbg_low("bkg params: sampley=%d radius_y=%d",
442 backg->sampley,backg->radius_y);
443
444 xsh_msg_dbg_low("bkg params: radius_x=%d",
445 backg->radius_x);
446
447 xsh_msg_dbg_low("rectify params: radius=%g bin_lambda=%g bin_space=%g",
448 rectify_par->rectif_radius,rectify_par->rectif_bin_lambda,
449 rectify_par->rectif_bin_space);
450
451 return cpl_error_get_code();
452
453}
454
455static cpl_error_code
456xsh_params_set_defaults(cpl_parameterlist* pars,
457 xsh_instrument* inst,
458 xsh_rectify_param * rectify_par,
459 double* lambda_ref)
460{
461 cpl_parameter *p=NULL;
462
463 check(p=xsh_parameters_find(pars,RECIPE_ID,"correctifu-lambdaref"));
464 if(cpl_parameter_get_double(p) <= 0) {
467 }
468 else {
471 }
472 else{
474 }
475 }
476 cpl_parameter_set_double(p, *lambda_ref);
477 }
478
480
481 cleanup:
482 return cpl_error_get_code();
483
484}
485
486
487static cpl_error_code
489 const char* rec_id,
490 xsh_instrument* inst,
491 xsh_rectify_param * rectify_par)
492{
493 cpl_parameter* p=NULL;
494
495 check(p=xsh_parameters_find(pars,rec_id,"rectify-bin-slit"));
496 if(cpl_parameter_get_double(p) <= 0) {
499 cpl_parameter_set_double(p,XSH_GEOM_SLIT_BIN_SIZE_PIPE_UVB);
500 } else if (xsh_instrument_get_arm(inst) == XSH_ARM_VIS){
502 cpl_parameter_set_double(p,XSH_GEOM_SLIT_BIN_SIZE_PIPE_VIS);
503 } else if (xsh_instrument_get_arm(inst) == XSH_ARM_NIR){
505 cpl_parameter_set_double(p,XSH_GEOM_SLIT_BIN_SIZE_PIPE_NIR);
506 }
507 }
508 check(p=xsh_parameters_find(pars,rec_id,"rectify-bin-lambda"));
509 if(cpl_parameter_get_double(p) <= 0) {
512 cpl_parameter_set_double(p,XSH_GEOM_WAVE_BIN_SIZE_PIPE_UVB);
513 } else if (xsh_instrument_get_arm(inst) == XSH_ARM_VIS){
515 cpl_parameter_set_double(p,XSH_GEOM_WAVE_BIN_SIZE_PIPE_VIS);
516 } else if (xsh_instrument_get_arm(inst) == XSH_ARM_NIR){
518 cpl_parameter_set_double(p,XSH_GEOM_WAVE_BIN_SIZE_PIPE_NIR);
519 }
520 }
521
522 cleanup:
523
524 return cpl_error_get_code();
525
526}
527
528/*----------------------------------------------------------------------------*/
536/*----------------------------------------------------------------------------*/
537static void xsh_geom_ifu(cpl_parameterlist* parameters,
538 cpl_frameset* frameset)
539{
540 const char* recipe_tags[1] = {XSH_TRACE};
541 int recipe_tags_size = 1;
542
543 /* Input frames */
544 cpl_frameset *raws = NULL;
545 cpl_frameset *calib = NULL;
546
547 /* Beware, do not "free" the following input frames, they are part
548 of the input frameset */
549 cpl_frame *bpmap = NULL;
550 cpl_frame *master_bias = NULL;
551 cpl_frame *master_dark = NULL;
552 cpl_frame *masterflat_frame = NULL;
553 cpl_frame *order_tab_edges = NULL;
554 cpl_frameset *wave_tabs_ifu = NULL ;
555 cpl_frame *model_config_frame = NULL ;
556 cpl_frame *wavemap_frame = NULL ;
557 cpl_frame *spectralformat_frame = NULL ;
558 cpl_frame *slitmap_frame = NULL ;
559 cpl_frame *disp_tab_frame = NULL;
560 cpl_frame *skymask_frame = NULL;
561
562 /* Parameters */
563 xsh_clipping_param *crh_clipping_par = NULL;
564 xsh_background_param *backg_par = NULL;
565 xsh_remove_crh_single_param *crh_single_par = NULL ;
566 xsh_rectify_param *rectify_par = NULL ;
567 int merge_par = 0;
568 xsh_localize_ifu_param *loc_ifu_par = NULL ;
569 xsh_stack_param* stack_par=NULL;
570 char* flat_method = NULL;
571 int do_computemap = 0, do_cube=0;
572 int check_afc = TRUE;
573 int recipe_use_model = FALSE;
575 int nb_raw_frames;
576
577 /* Intermediate frames */
578#if 0
579 cpl_frameset * on = NULL, * off = NULL ;
580#endif
581 cpl_frame * crhm_frame = NULL ;
582 cpl_frame * rmbias = NULL;
583 cpl_frame * rmdark = NULL;
584 cpl_frame * rmbkg = NULL ;
585 cpl_frame * blaze_frame = NULL;
586 cpl_frame *div_frame = NULL ;
587 cpl_frameset *rect_frameset = NULL ;
588 cpl_frame * clean_frame = NULL ;
590 /* Output Frames (results)*/
591 cpl_frame* grid_backg=NULL;
592 cpl_frame* frame_backg=NULL;
593 cpl_frameset* rect_frameset_eso=NULL;
594 cpl_frameset* rect_frameset_tab=NULL;
595 cpl_frameset *shiftifu_frameset=NULL;
596 cpl_frameset *shiftifu_old_frameset = NULL;
597 cpl_frameset *merge_frameset=NULL;
598 cpl_frameset *locifu_frameset=NULL;
599 cpl_frame *data_cube = NULL ;
600
601 const char* ftag=NULL;
602 char tag[256];
603 char *rec_prefix = NULL;
604 char geom_prefix[256];
605
606 int pre_overscan_corr=0;
607 int i, geom_niter = 1;
608 double lambda_ref;
609 double lambdaref_hsize;
610
611 /**************************************************************************/
612 /* DFS management */
613 /**************************************************************************/
614 check( xsh_begin( frameset, parameters, &instrument, &raws, &calib,
615 recipe_tags, recipe_tags_size,RECIPE_ID, XSH_BINARY_VERSION,
617
618 assure( instrument->mode == XSH_MODE_IFU, CPL_ERROR_ILLEGAL_INPUT,
619 "Instrument NOT in IFU Mode");
620
622
623 /* One should have 1 or >=3 input frames. 2 is not permitted */
624 check( nb_raw_frames = cpl_frameset_get_size( raws));
625 XSH_ASSURE_NOT_ILLEGAL( nb_raw_frames == 1 || nb_raw_frames >= 3 ) ;
626
627 check( rec_prefix = xsh_set_recipe_file_prefix(raws,"xsh_geom_ifu"));
628
629 /**************************************************************************/
630 /* Recipe frames */
631 /**************************************************************************/
632 bpmap = xsh_find_master_bpmap(calib);
633
634 /* In UVB and VIS mode */
636 /* RAWS frameset must have only one file */
637 check( master_bias = xsh_find_master_bias(calib,instrument));
638 }
639#if 0
640 // Dont care ON/OFF in case of NIR (may change later)
641 /* IN NIR mode */
642 else {
643 /* split on and off files */
644 xsh_msg( "Calling xsh_dfs_split_nir" ) ;
645 check(xsh_dfs_split_nir(raws, &on, &off));
646 xsh_msg( " Nb ON: %d, OFF: %d", cpl_frameset_get_size(on),
647 cpl_frameset_get_size(off) ) ;
648 XSH_ASSURE_NOT_ILLEGAL(cpl_frameset_get_size(on) >= 3);
649 XSH_ASSURE_NOT_ILLEGAL(cpl_frameset_get_size(off) >= 3);
650 }
651#endif
652
653 check( order_tab_edges = xsh_find_order_tab_edges( calib, instrument));
654
655 /* one should have either model config frame or wave sol frame */
656 if(NULL==(model_config_frame = xsh_find_frame_with_tag( calib,
658 instrument))) {
659
660 wave_tabs_ifu = xsh_find_wave_tab_ifu( calib, instrument);
661
662 }
663 //xsh_error_reset();
664
665 if( (model_config_frame!=NULL) && (wave_tabs_ifu != NULL) ) {
666
667 xsh_msg_error("You cannot provide both a %s and a %s frame. Decide if you are in poly or physical model mode. We exit",
669 goto cleanup;
670 }
671
672 if((model_config_frame==NULL) && ( wave_tabs_ifu == NULL) ) {
673 xsh_msg_error("You must provide either a %s or a %s frame",
675 goto cleanup;
676 }
677
678 if ( (master_dark = xsh_find_master_dark( calib, instrument ) ) == NULL ){
679 xsh_msg_warning("Frame %s not provided",XSH_MASTER_DARK);
681 }
682
683 check( masterflat_frame = xsh_find_master_flat( calib, instrument));
684 check(spectralformat_frame = xsh_find_spectral_format( calib, instrument ) ) ;
685
686 /**************************************************************************/
687 /* Recipe parameters */
688 /**************************************************************************/
689
690 recipe_use_model = ( model_config_frame != NULL);
691 check( stack_par = xsh_stack_frames_get( RECIPE_ID, parameters));
693 parameters));
695 parameters));
697 parameters));
698
700 parameters));
701
703 parameters));
704 check( geom_niter = xsh_parameters_get_int( parameters, RECIPE_ID,
705 "correctifu-niter"));
706 check( lambda_ref = xsh_parameters_get_double( parameters, RECIPE_ID,
707 "correctifu-lambdaref"));
708 check( lambdaref_hsize = xsh_parameters_get_double( parameters, RECIPE_ID,
709 "correctifu-lambdaref-hsize"));
710 check( do_cube = xsh_parameters_get_boolean( parameters, RECIPE_ID,
711 "do-cube"));
712
713 check( do_computemap = xsh_parameters_get_boolean( parameters, RECIPE_ID,
714 "compute-map"));
715
716 check( check_afc = xsh_parameters_get_boolean( parameters, RECIPE_ID,
717 "check-afc"));
718 rectify_par->conserve_flux=FALSE;
719 if ( do_computemap && recipe_use_model==FALSE){
720 check( disp_tab_frame = xsh_find_frame_with_tag( calib,XSH_DISP_TAB_AFC,
721 instrument));
722 }
723
724 check(xsh_params_set_defaults(parameters,instrument,rectify_par, &lambda_ref));
725 /* adjust relevant parameter to binning */
727 check(xsh_params_bin_scale(raws,backg_par));
728 }
729 check(xsh_params_monitor(backg_par,rectify_par));
730
731
732 if ( loc_ifu_par->use_skymask == TRUE){
733 xsh_msg("Using sky mask");
734 check( skymask_frame = xsh_find_frame_with_tag( calib, XSH_SKY_LINE_LIST,
735 instrument));
736 }
737
738 /**************************************************************************/
739 /* Recipe code */
740 /**************************************************************************/
741 /* prepare RAW frames in XSH format */
742
743 xsh_msg( "---Prepare raws frames");
744 check( xsh_prepare( raws, bpmap, master_bias, XSH_OBJECT_IFU_STARE,
745 instrument,pre_overscan_corr,CPL_TRUE));
746
747 /* Removing Cosmic Rays (if more than 2 frames)
748 Output frame in PRE format */
749 if ( nb_raw_frames >= 3 ) {
750 xsh_msg( "---Remove cosmics");
751
753 check_msg( crhm_frame = xsh_check_remove_crh_multiple( raws,
754 ftag,stack_par,
755 NULL,
756 instrument, NULL,NULL ),
757 "Error in xsh_remove_crh" ) ;
758 }
759 else {
760 /* Only one frame in raws frameset, get it (it's first of course !) */
761 check( crhm_frame = cpl_frame_duplicate(cpl_frameset_get_frame( raws,0 )));
762 }
763 xsh_msg( "created %s", cpl_frame_get_filename( crhm_frame));
764
765 if ( do_computemap){
766 if (recipe_use_model){
767 char wave_map_tag[256];
768 char slit_map_tag[256];
769 int found_temp=true;
770
771 check(xsh_model_temperature_update_frame(&model_config_frame,crhm_frame,
772 instrument,&found_temp));
773
774 sprintf(wave_map_tag,"%s_%s",rec_prefix,XSH_WAVE_MAP_MODEL);
775 sprintf(slit_map_tag,"%s_%s",rec_prefix,XSH_SLIT_MAP_MODEL);
776 check( xsh_create_model_map( model_config_frame, instrument,
777 wave_map_tag,slit_map_tag,
778 &wavemap_frame, &slitmap_frame,1));
779 }
780 else{
781 xsh_msg( "Compute the wave map and the slit map");
782 check( xsh_create_map( disp_tab_frame, order_tab_edges,
783 crhm_frame, instrument,
784 &wavemap_frame, &slitmap_frame,rec_prefix));
785 }
786 cpl_frameset_insert( calib, wavemap_frame);
787 cpl_frameset_insert( calib, slitmap_frame);
788 }
789 else{
790 check( wavemap_frame = xsh_find_wavemap( calib, instrument));
791 slitmap_frame = xsh_find_slitmap(calib, instrument);
792 }
793
794 check( rmbias = xsh_check_subtract_bias( crhm_frame, master_bias,
795 instrument, rec_prefix, pre_overscan_corr,0));
796
797 /**************************************************************************/
798 /* Check that SCI IFU frame and AFC corrected CFG are proper */
799 /**************************************************************************/
800 check( xsh_check_afc( check_afc, model_config_frame,
801 rmbias, wave_tabs_ifu, order_tab_edges, disp_tab_frame,
802 instrument));
803
804 /* Subtract Dark if necessary */
805 check( rmdark = xsh_check_subtract_dark( rmbias, master_dark,
806 instrument, rec_prefix));
807
808 /* subtract background */
809 xsh_msg("---Subtract_background");
810 check( rmbkg = xsh_subtract_background( rmdark,
811 order_tab_edges, backg_par, instrument, "GEOM_IFU",&grid_backg,
812 &frame_backg,0,0,0 ));
813
814 /* divide by */
815 xsh_msg("---Do flatfielding");
816 sprintf( tag, "GEOM_IFU_FF_%s",
818
819 check( flat_method = xsh_parameters_get_string( parameters, RECIPE_ID,
820 "flat-method"));
821
822 xsh_msg("method %s", flat_method);
823
824 if ( strcmp( flat_method, "master") == 0){
825 check( div_frame = xsh_divide_flat( rmbkg, masterflat_frame,
826 tag, instrument));
827 }
828 else{
829 xsh_msg("---Create blaze image");
830 check( blaze_frame = xsh_blaze_image( masterflat_frame, order_tab_edges,
831 instrument));
832 check( div_frame = xsh_divide_by_blaze( rmbkg, blaze_frame, instrument));
833 }
834
835 sprintf( geom_prefix, "orig_%s", rec_prefix);
836 /* Rectify object */
837 for( i=1; i<= geom_niter; i++){
838 xsh_free_frameset( &rect_frameset);
839 xsh_free_frameset( &rect_frameset_eso);
840 xsh_free_frameset( &rect_frameset_tab) ;
841 xsh_free_frameset( &merge_frameset);
842 xsh_free_frameset( &locifu_frameset);
843
844 xsh_msg( "---Do rectify for ifu: iteration %d/%d", i, geom_niter);
845
846 rect_frameset_eso=cpl_frameset_new();
847 rect_frameset_tab=cpl_frameset_new();
848
849 check( rect_frameset = xsh_rectify_ifu( div_frame, order_tab_edges,
850 wave_tabs_ifu, shiftifu_old_frameset, model_config_frame,
851 instrument, rectify_par,
852 spectralformat_frame, slitmap_frame,
853 &rect_frameset_eso, &rect_frameset_tab, geom_prefix));
854
855 /* Merge each slitlet */
856 check( merge_frameset = xsh_merge_ord_ifu( rect_frameset,
857 instrument, merge_par, geom_prefix));
858
859 /* Localize ifu */
860 check( locifu_frameset = xsh_localize_ifu( merge_frameset,
861 skymask_frame, loc_ifu_par, instrument, geom_prefix));
862
863 /* Compute the shift */
864 check( shiftifu_frameset = xsh_compute_shift_ifu( lambda_ref,
865 lambdaref_hsize,
866 locifu_frameset, shiftifu_old_frameset, instrument, rec_prefix));
867
868 xsh_free_frameset( &shiftifu_old_frameset);
869 shiftifu_old_frameset = shiftifu_frameset;
870 sprintf( geom_prefix, "%s", rec_prefix);
871 }
872
873 /* Building 3D (data cube) */
874 if ( do_cube){
875 xsh_free_frameset( &rect_frameset);
876 xsh_free_frameset( &rect_frameset_eso);
877 xsh_free_frameset( &rect_frameset_tab) ;
878 xsh_free_frameset( &merge_frameset);
879 xsh_free_frameset( &locifu_frameset);
880
881 rect_frameset_eso=cpl_frameset_new();
882 rect_frameset_tab=cpl_frameset_new();
883
884 check( rect_frameset = xsh_rectify_ifu( div_frame, order_tab_edges,
885 wave_tabs_ifu, shiftifu_frameset, model_config_frame,
886 instrument, rectify_par,
887 spectralformat_frame, slitmap_frame,
888 &rect_frameset_eso, &rect_frameset_tab, rec_prefix));
889
890 /* Merge each slitlet */
891 check( merge_frameset = xsh_merge_ord_ifu( rect_frameset,
892 instrument, merge_par, rec_prefix));
893 /* build cube */
894 check( data_cube = xsh_cube( merge_frameset, instrument, rec_prefix));
895 }
896
897 /* Save recipe products */
898 xsh_msg( "---Save products");
899
900 for( i = 0 ; i<3 ; i++ ) {
901 cpl_frame *shiftifu_frame = NULL;
902
903 check( shiftifu_frame = cpl_frameset_get_frame( shiftifu_frameset, i));
904 check( xsh_add_product_table( shiftifu_frame, frameset,parameters,
905 RECIPE_ID, instrument,NULL));
906 }
907
908
909 if ( do_cube){
910 const char* name=NULL;
911 cpl_propertylist* plist=NULL;
912 int naxis2=0;
913 int save_size=0;
914 const int peack_search_hsize=5;
915 int method=0;
916 cpl_frame* qc_trace_frame=NULL;
917
918 check( xsh_add_product_pre_3d( data_cube, frameset, parameters,
920
921 name=cpl_frame_get_filename(data_cube);
922 plist=cpl_propertylist_load(name,0);
923 naxis2=xsh_pfits_get_naxis2(plist);
924 xsh_free_propertylist(&plist);
925 check( qc_trace_frame=xsh_cube_qc_trace_window(data_cube,
926 instrument,tag, rec_prefix,
927 save_size+1,
928 naxis2-save_size,
929 peack_search_hsize,
930 method,0));
931
932
933 if(qc_trace_frame) {
934 check(xsh_add_product_table(qc_trace_frame,frameset,parameters,
935 RECIPE_ID,instrument,NULL));
936 }
937 xsh_free_frame(&qc_trace_frame);
938 }
939
940 cleanup:
941 xsh_end( RECIPE_ID, frameset, parameters);
942 XSH_FREE( rec_prefix);
943
944 XSH_FREE( crh_clipping_par);
945 XSH_FREE( backg_par);
946 XSH_FREE( crh_single_par);
947 XSH_FREE( rectify_par);
948 XSH_FREE( stack_par);
949
950 XSH_FREE( loc_ifu_par);
952
953 xsh_free_frameset( &raws);
954 xsh_free_frameset( &calib);
955 xsh_free_frameset( &wave_tabs_ifu);
956
957 xsh_free_frame( &crhm_frame ) ;
958 xsh_free_frame( &rmbias);
959 xsh_free_frame( &rmdark);
960 xsh_free_frame( &rmbkg);
961 xsh_free_frame( &blaze_frame);
962 xsh_free_frame( &div_frame);
963
964 xsh_free_frameset( &rect_frameset);
965 xsh_free_frameset( &rect_frameset_eso);
966 xsh_free_frameset( &rect_frameset_tab) ;
967 xsh_free_frameset( &merge_frameset);
968 xsh_free_frameset( &locifu_frameset);
969 xsh_free_frameset( &shiftifu_frameset);
970 xsh_free_frame( &clean_frame);
971 xsh_free_frame( &grid_backg);
972 xsh_free_frame( &frame_backg);
973 xsh_free_frame( &data_cube);
974 return;
975}
976
static xsh_instrument * instrument
int binx
int biny
cpl_frame * xsh_divide_by_blaze(cpl_frame *pre_frame, cpl_frame *blaze_frame, xsh_instrument *instrument)
Divide a pre image by the blaze image.
Definition: xsh_blaze.c:71
cpl_frame * xsh_blaze_image(cpl_frame *masterflat_frame, cpl_frame *order_frame, xsh_instrument *instrument)
Normalize a master flat frame order by order.
Definition: xsh_blaze.c:143
cpl_frameset * xsh_compute_shift_ifu(double lambda_ref, double lambdaref_hsize, cpl_frameset *objpos_frameset, cpl_frameset *shiftifu_frameset, xsh_instrument *instrument, const char *prefix)
Compute the shift in slit between reference wavelength and others for all the slitlets.
cpl_frame * xsh_divide_flat(cpl_frame *frame, cpl_frame *flat, const char *tag, xsh_instrument *instr)
divide PRE frame with the master FLAT frame
Definition: xsh_divide.c:75
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
#define XSH_ASSURE_NOT_ILLEGAL(cond)
Definition: xsh_error.h:107
#define assure(CONDITION, ERROR_CODE,...)
Definition: xsh_error.h:54
#define check(COMMAND)
Definition: xsh_error.h:71
#define xsh_error_dump(level)
Definition: xsh_error.h:92
#define check_msg(COMMAND,...)
Definition: xsh_error.h:62
#define xsh_error_reset()
Definition: xsh_error.h:87
cpl_frame * xsh_cube(cpl_frameset *merge2d_frameset, xsh_instrument *instrument, const char *rec_prefix)
Create a cube.
Definition: xsh_format.c:472
static cpl_error_code xsh_params_set_defaults(cpl_parameterlist *pars, xsh_instrument *inst, xsh_rectify_param *rectify_par, double *lambda_ref)
Definition: xsh_geom_ifu.c:456
#define XSH_GEOM_SLIT_BIN_SIZE_PIPE_NIR
Definition: xsh_geom_ifu.c:81
static int xsh_geom_ifu_destroy(cpl_plugin *)
Destroy what has been created by the 'create' function.
Definition: xsh_geom_ifu.c:407
#define RECIPE_CONTACT
Definition: xsh_geom_ifu.c:77
static cpl_error_code xsh_rectify_params_set_defaults_drl(cpl_parameterlist *pars, const char *rec_id, xsh_instrument *inst, xsh_rectify_param *rectify_par)
Definition: xsh_geom_ifu.c:488
static int xsh_geom_ifu_exec(cpl_plugin *)
Execute the plugin instance given by the interface.
Definition: xsh_geom_ifu.c:373
int cpl_plugin_get_info(cpl_pluginlist *list)
Build the list of available plugins, for this module.
Definition: xsh_geom_ifu.c:140
static cpl_error_code xsh_params_monitor(xsh_background_param *backg, xsh_rectify_param *rectify_par)
Definition: xsh_geom_ifu.c:436
#define XSH_GEOM_SLIT_BIN_SIZE_PIPE_VIS
Definition: xsh_geom_ifu.c:80
static cpl_error_code xsh_params_bin_scale(cpl_frameset *raws, xsh_background_param *backg)
Scales input parameters for binning.
Definition: xsh_geom_ifu.c:299
#define XSH_GEOM_SLIT_BIN_SIZE_PIPE_UVB
Definition: xsh_geom_ifu.c:79
static char xsh_geom_ifu_description_short[]
Definition: xsh_geom_ifu.c:108
#define XSH_GEOM_WAVE_BIN_SIZE_PIPE_NIR
Definition: xsh_geom_ifu.c:84
static int xsh_geom_ifu_create(cpl_plugin *)
Setup the recipe options.
Definition: xsh_geom_ifu.c:182
#define XSH_GEOM_WAVE_BIN_SIZE_PIPE_UVB
Definition: xsh_geom_ifu.c:82
#define RECIPE_ID
Definition: xsh_geom_ifu.c:75
#define RECIPE_AUTHOR
Definition: xsh_geom_ifu.c:76
static char xsh_geom_ifu_description[]
Definition: xsh_geom_ifu.c:111
static void xsh_geom_ifu(cpl_parameterlist *, cpl_frameset *)
Interpret the command line options and execute the data processing.
Definition: xsh_geom_ifu.c:537
#define XSH_GEOM_WAVE_BIN_SIZE_PIPE_VIS
Definition: xsh_geom_ifu.c:83
const char * xsh_instrument_arm_tostring(xsh_instrument *i)
Get the string associated with an arm.
XSH_ARM xsh_instrument_get_arm(xsh_instrument *i)
Get an arm on instrument structure.
void xsh_instrument_free(xsh_instrument **instrument)
free an instrument structure
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_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.
#define xsh_msg_warning(...)
Print an warning message.
Definition: xsh_msg.h:88
#define xsh_msg_error(...)
Print an error message.
Definition: xsh_msg.h:62
#define xsh_msg(...)
Print a message on info level.
Definition: xsh_msg.h:121
#define xsh_msg_dbg_low(...)
Definition: xsh_msg.h:48
int xsh_pfits_get_binx(const cpl_propertylist *plist)
find out the BINX value
Definition: xsh_pfits.c:289
int xsh_pfits_get_biny(const cpl_propertylist *plist)
find out the BINY value
Definition: xsh_pfits.c:306
int xsh_pfits_get_naxis2(const cpl_propertylist *plist)
find out the NAXIS2 value
Definition: xsh_pfits.c:244
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_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
void xsh_free_parameterlist(cpl_parameterlist **p)
Deallocate a parameter list and set the pointer to NULL.
Definition: xsh_utils.c:2224
void xsh_free_frame(cpl_frame **f)
Deallocate a frame and set the pointer to NULL.
Definition: xsh_utils.c:2269
void xsh_free_frameset(cpl_frameset **f)
Deallocate a frame set and set the pointer to NULL.
Definition: xsh_utils.c:2254
char * xsh_set_recipe_file_prefix(cpl_frameset *raw, const char *recipe)
Set recipe frames prefix.
Definition: xsh_utils.c:601
const char * xsh_get_license(void)
Get the pipeline copyright and license.
Definition: xsh_utils.c:1193
void xsh_init(void)
Reset library state.
Definition: xsh_utils.c:1160
cpl_error_code xsh_begin(cpl_frameset *frames, const cpl_parameterlist *parameters, xsh_instrument **instrument, cpl_frameset **raws, cpl_frameset **calib, const char *tag_list[], int tag_list_size, const char *recipe_id, unsigned int binary_version, const char *short_descr)
Recipe initialization.
Definition: xsh_utils.c:1244
void xsh_free_propertylist(cpl_propertylist **p)
Deallocate a property list and set the pointer to NULL.
Definition: xsh_utils.c:2179
cpl_error_code xsh_end(const char *recipe_id, cpl_frameset *frames, cpl_parameterlist *parameters)
Recipe termination.
Definition: xsh_utils.c:1519
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)
void xsh_create_model_map(cpl_frame *model_frame, xsh_instrument *instrument, const char *wtag, const char *stag, cpl_frame **wavemap_frame, cpl_frame **slitmap_frame, const int save_tmp)
@ XSH_ARM_UVB
@ XSH_ARM_NIR
@ XSH_ARM_VIS
@ XSH_MODE_IFU
const char * method
Definition: xsh_detmon_lg.c:78
cpl_frame * xsh_find_wavemap(cpl_frameset *frames, xsh_instrument *instr)
Find Wave Map frame. The frame returned should not be free by the caller.
Definition: xsh_dfs.c:3983
cpl_frame * xsh_find_master_dark(cpl_frameset *frames, xsh_instrument *instr)
Find master dark frame.
Definition: xsh_dfs.c:3404
cpl_frame * xsh_find_spectral_format(cpl_frameset *frames, xsh_instrument *instr)
Find spectral format frame.
Definition: xsh_dfs.c:4318
cpl_frame * xsh_find_order_tab_edges(cpl_frameset *frames, xsh_instrument *instr)
Find an order tab EDGES.
Definition: xsh_dfs.c:3595
cpl_frame * xsh_find_master_bias(cpl_frameset *frames, xsh_instrument *instr)
Find master bias frame.
Definition: xsh_dfs.c:3319
void xsh_add_product_pre_3d(cpl_frame *frame, cpl_frameset *frameset, const cpl_parameterlist *parameters, const char *recipe_id, xsh_instrument *instr)
Add 3d product frame.
Definition: xsh_dfs.c:2627
void xsh_add_product_table(cpl_frame *frame, cpl_frameset *frameset, const cpl_parameterlist *parameters, const char *recipe_id, xsh_instrument *instrument, const char *final_prefix)
Save Table product (input frame has several extensions, 1 table per extension)
Definition: xsh_dfs.c:3146
void xsh_dfs_split_nir(cpl_frameset *input, cpl_frameset **on, cpl_frameset **off)
split input RAW NIR sof in ON and OFF
Definition: xsh_dfs.c:1297
cpl_frameset * xsh_find_wave_tab_ifu(cpl_frameset *frames, xsh_instrument *instrument)
Find wave tab ARC (for IFU 3 frames)
Definition: xsh_dfs.c:3756
cpl_frame * xsh_find_slitmap(cpl_frameset *frames, xsh_instrument *instr)
Find a slit map.
Definition: xsh_dfs.c:3673
cpl_frame * xsh_find_frame_with_tag(cpl_frameset *frames, const char *tag, xsh_instrument *instr)
Find frame with a given tag.
Definition: xsh_dfs.c:3347
cpl_frame * xsh_find_master_flat(cpl_frameset *frames, xsh_instrument *instr)
Find master flat frame.
Definition: xsh_dfs.c:3426
cpl_frame * xsh_find_master_bpmap(cpl_frameset *set)
find the master bad pixel map in a set of files
Definition: xsh_dfs.c:1621
#define XSH_MOD_CFG_OPT_AFC
Definition: xsh_dfs.h:1256
#define XSH_TRACE
Definition: xsh_dfs.h:139
#define XSH_MASTER_DARK
Definition: xsh_dfs.h:550
#define XSH_MOD_CFG_TAB
Definition: xsh_dfs.h:1251
#define XSH_SLIT_STARE_REMOVE_CRH
Definition: xsh_dfs.h:156
#define XSH_SLIT_MAP_MODEL
Definition: xsh_dfs.h:146
#define XSH_CORRECTIFU_LAMBDAREF_PIPE_NIR
Definition: xsh_dfs.h:70
#define XSH_OBJECT_IFU_STARE
Definition: xsh_dfs.h:230
#define XSH_WAVE_MAP_MODEL
Definition: xsh_dfs.h:923
#define XSH_GET_TAG_FROM_ARM(TAG, instr)
Definition: xsh_dfs.h:1548
#define XSH_CORRECTIFU_LAMBDAREF_PIPE_UVB
Definition: xsh_dfs.h:68
#define XSH_SKY_LINE_LIST
Definition: xsh_dfs.h:944
#define XSH_WAVE_TAB_2D
Definition: xsh_dfs.h:556
#define XSH_CORRECTIFU_LAMBDAREF_PIPE_VIS
Definition: xsh_dfs.h:69
#define XSH_DISP_TAB_AFC
Definition: xsh_dfs.h:902
cpl_frame * xsh_check_remove_crh_multiple(cpl_frameset *raws, const char *ftag, xsh_stack_param *stack_par, xsh_clipping_param *crh_clipping_par, xsh_instrument *instr, cpl_imagelist **lista, cpl_image **listb)
Check function.
void xsh_check_afc(int check_flag, cpl_frame *model_frame, cpl_frame *sci_frame, cpl_frameset *wave_frameset, cpl_frame *order_tab_frame, cpl_frame *disp_tab_frame, xsh_instrument *instrument)
Check AFC frame.
cpl_frame * xsh_check_subtract_bias(cpl_frame *crhm_frame, cpl_frame *master_bias, xsh_instrument *instrument, const char *prefix, const int pre_overscan_corr, const int save_tmp)
Check function to subtract bias.
cpl_frame * xsh_check_subtract_dark(cpl_frame *rmbias_frame, cpl_frame *master_dark, xsh_instrument *instrument, const char *prefix)
Check function for dark subtraction.
cpl_error_code xsh_model_temperature_update_frame(cpl_frame **model_config_frame, cpl_frame *ref_frame, xsh_instrument *instrument, int *found_temp)
cpl_parameter * xsh_parameters_find(cpl_parameterlist *list, const char *recipe_id, const char *name)
find a parameter
void xsh_parameters_pre_overscan(const char *recipe_id, cpl_parameterlist *plist)
void xsh_parameters_new_boolean(cpl_parameterlist *list, const char *recipe_id, const char *name, int value, const char *comment)
void xsh_parameters_stack_create(const char *recipe_id, cpl_parameterlist *list, xsh_stack_param sp)
create the RON determination parameters in a parameters list
int xsh_parameters_get_boolean(const cpl_parameterlist *list, const char *recipe_id, const char *name)
xsh_stack_param * xsh_stack_frames_get(const char *recipe_id, cpl_parameterlist *list)
get the detect arclines parameters in a parameters list
double xsh_parameters_get_double(const cpl_parameterlist *list, const char *recipe_id, const char *name)
cpl_error_code xsh_parameters_decode_bp(const char *recipe_id, cpl_parameterlist *plist, const int ival)
void xsh_parameters_new_double(cpl_parameterlist *list, const char *recipe_id, const char *name, double value, const char *comment)
void xsh_parameters_localize_ifu_create(const char *recipe_id, cpl_parameterlist *plist, xsh_localize_ifu_param p)
void xsh_parameters_clipping_crh_create(const char *recipe_id, cpl_parameterlist *list, xsh_clipping_param p)
create the crh clipping parameters in a parameters list
void xsh_parameters_rectify_create(const char *recipe_id, cpl_parameterlist *plist, xsh_rectify_param p)
void xsh_parameters_background_create(const char *recipe_id, cpl_parameterlist *list)
create the subtract background parameters in a parameters list
xsh_rectify_param * xsh_parameters_rectify_get(const char *recipe_id, cpl_parameterlist *list)
void xsh_parameters_remove_crh_single_create(const char *recipe_id, cpl_parameterlist *plist, xsh_remove_crh_single_param p)
xsh_remove_crh_single_param * xsh_parameters_remove_crh_single_get(const char *recipe_id, cpl_parameterlist *list)
int xsh_parameters_get_int(const cpl_parameterlist *list, const char *recipe_id, const char *name)
xsh_localize_ifu_param * xsh_parameters_localize_ifu_get(const char *recipe_id, cpl_parameterlist *list)
xsh_clipping_param * xsh_parameters_clipping_crh_get(const char *recipe_id, cpl_parameterlist *list)
get the crh clipping parameters in a parameters list
void xsh_parameters_generic(const char *recipe_id, cpl_parameterlist *plist)
cpl_error_code xsh_recipe_params_check(cpl_parameterlist *parameters, xsh_instrument *instrument, const char *rec_id)
void xsh_parameters_new_int(cpl_parameterlist *list, const char *recipe_id, const char *name, int value, const char *comment)
xsh_background_param * xsh_parameters_background_get(const char *recipe_id, cpl_parameterlist *list)
get the background parameters in a parameters list
char * xsh_parameters_get_string(const cpl_parameterlist *list, const char *recipe_id, const char *name)
#define XSH_FREE(POINTER)
Definition: xsh_utils.h:92
cpl_frame * xsh_cube_qc_trace_window(cpl_frame *frm_cube, xsh_instrument *instrument, const char *suffix, const char *rec_prefix, const int win_min, const int win_max, const int hsize, const int method, const int compute_qc)
Trace object position in a cube.