X-shooter Pipeline Reference Manual 3.8.15
test-xsh_combine_nod.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: 2012-01-16 21:10:13 $
23 * $Revision: 1.20 $
24 */
25
26#ifdef HAVE_CONFIG_H
27# include <config.h>
28#endif
29
30/*-------------------------------------------------------------------------*/
36/*-------------------------------------------------------------------------*/
39/*--------------------------------------------------------------------------
40 Includes
41 --------------------------------------------------------------------------*/
42
43#include <tests.h>
44
45#include <xsh_data_pre.h>
46#include <xsh_error.h>
47#include <xsh_msg.h>
48#include <xsh_data_instrument.h>
49#include <xsh_data_the_map.h>
52
53#include <xsh_drl.h>
54#include <xsh_pfits.h>
55
56#include <xsh_badpixelmap.h>
57
58#include <cpl.h>
59#include <math.h>
60
61#include <getopt.h>
62
63/*--------------------------------------------------------------------------
64 Defines
65 --------------------------------------------------------------------------*/
66
67#define MODULE_ID "XSH_COMBINE_NOD"
68
69/*--------------------------------------------------------------------------
70 Implementation
71 --------------------------------------------------------------------------*/
72enum {
76} ;
77
78static const char * Options = "" ;
79
80static struct option long_options[] = {
81 {"kernel", required_argument, 0, KERNEL_OPT},
82 {"radius", required_argument, 0, RADIUS_OPT},
83 {"bin-lambda", required_argument, 0, BIN_LAMBDA_OPT},
84 {"bin-space", required_argument, 0, BIN_SPACE_OPT},
85 {"order-min", required_argument, 0, MIN_ORDER_OPT},
86 {"order-max", required_argument, 0, MAX_ORDER_OPT},
87 {"slit-min",required_argument, 0, SLIT_MIN_OPT},
88 {"slit-n",required_argument, 0, NSLIT_OPT},
89 {"use-localization",required_argument, 0, USELOC_OPT},
90 {"nod-set",required_argument, 0, NOD_SET_OPT},
91 {"nod-order",required_argument, 0, NOD_ORDER_OPT},
92 {"help", 0, 0, HELP_OPT},
93 {0, 0, 0, 0}
94};
95
96static void Help( void )
97{
98 puts( "Unitary test of xsh_combine_nod" ) ;
99 puts( "Usage: test_rectify [options] <input_files>" ) ;
100 puts( "Options" ) ;
101 puts( " --kernel=<name> : Name of the rectify kernel" ) ;
102 puts( " --radius=<nn> : Radius (default 4)" ) ;
103 puts( " --bin-lambda=<n> : Bin in Lambda (default 0.1)" ) ;
104 puts( " --bin-space=<n> : Bin in Slit (default 0.1)" ) ;
105 puts( " --order-min=<n> : Minimum abs order" );
106 puts( " --order-max=<n> : Maximum abs order" );
107 puts( " --slit-min=<n> : Minimum slit to rectify" );
108 puts( " --slit-n=<n> : Number of pixels in slit rectified frame" );
109 puts( " --use-localization : 1 if tou want to use it");
110 puts( " --nod-set=<file> : Set of rectified shifted frames with tag OBJECT_SLIT_NOD_arm");
111 puts( " --nod-order=<n> : abs order where we analyse nod" );
112 puts( " --help : What you see" ) ;
113 puts( "\nInput Files" ) ;
114 puts( "The input files argument MUST be in this order:" ) ;
115 puts( " 1. Science frame in PRE format" ) ;
116 puts( " 2. SOF\n" ) ;
117 TEST_END();
118}
119
120static void HandleOptions( int argc, char **argv,
121 xsh_rectify_param *rectify_par, int *order_min, int *order_max,
122 double *slit_min, int *nslit, int *use_loc, char** nod_set_name)
123{
124 int opt ;
125 int option_index = 0;
126
127 while (( opt = getopt_long (argc, argv, Options,
128 long_options, &option_index)) != EOF )
129 switch ( opt ) {
130 case KERNEL_OPT:
131 strcpy( rectify_par->rectif_kernel, optarg ) ;
132 break ;
133 case RADIUS_OPT:
134 rectify_par->rectif_radius = atof( optarg);
135 break ;
136 case BIN_LAMBDA_OPT:
137 sscanf( optarg, "%64lf", &rectify_par->rectif_bin_lambda ) ;
138 break ;
139 case BIN_SPACE_OPT:
140 sscanf( optarg, "%64lf", &rectify_par->rectif_bin_space ) ;
141 break ;
142 case MIN_ORDER_OPT:
143 sscanf( optarg, "%64d", order_min);
144 break;
145 case MAX_ORDER_OPT:
146 sscanf( optarg, "%64d", order_max);
147 break;
148 case SLIT_MIN_OPT:
149 sscanf( optarg, "%64lf", slit_min) ;
150 break ;
151 case NSLIT_OPT:
152 sscanf( optarg, "%64d", nslit);
153 break ;
154 case USELOC_OPT:
155 sscanf( optarg, "%64d", use_loc);
156 break;
157 case NOD_SET_OPT:
158 *nod_set_name = optarg;
159 break;
160 case NOD_ORDER_OPT:
161 sscanf( optarg, "%64d", order_min);
162 break;
163 default: Help() ; exit( 0 ) ;
164 }
165}
166
167
168cpl_frame *create_zero_rectify( cpl_frame* rec_frame, int iorder, xsh_instrument* instr)
169{
170 const char* rec_name = NULL;
171 xsh_rec_list* rec_list = NULL;
172 int ilambda=0, islit=0;
173 int nlambda = 0, nslit=0;
174 float *flux = NULL;
175 char name[256];
176 char *shortname = NULL;
177 cpl_frame *res_frame = NULL;
178
179 XSH_ASSURE_NOT_NULL( rec_frame);
180
181 check( rec_name = cpl_frame_get_filename( rec_frame));
182
183 shortname = strrchr( rec_name, '/');
184
185 if (shortname != NULL){
186 sprintf( name, "ZERO_%s",shortname+1);
187 }
188 else{
189 sprintf( name, "ZERO_%s",rec_name);
190 }
191
192 xsh_msg( "name %s", name);
193
194 check( rec_list = xsh_rec_list_load( rec_frame, instr));
195
196 check( nlambda = xsh_rec_list_get_nlambda( rec_list, iorder));
197 check( nslit = xsh_rec_list_get_nslit( rec_list, iorder));
198 check( flux = xsh_rec_list_get_data1( rec_list, iorder));
199
200 for( islit=0; islit < nslit; islit++){
201 double val =0.0;
202
203 for(ilambda=0; ilambda < nlambda; ilambda++){
204 flux[ilambda+islit*nlambda] = val;
205 }
206 }
207
208 check( res_frame = xsh_rec_list_save( rec_list, name, "ZERO_REC", 1));
209
210 cleanup:
211 if (cpl_error_get_code() != CPL_ERROR_NONE){
212 xsh_free_frame( &res_frame);
213 }
214 xsh_rec_list_free( &rec_list);
215 return res_frame;
216}
217
218
219
220
221
222void analyse_rectify( cpl_frame* rec_frame, int iorder, xsh_instrument* instr)
223{
224 const char* rec_name = NULL;
225 xsh_rec_list* rec_list = NULL;
226 int ilambda=0, islit=0;
227 int nlambda = 0, nslit=0;
228 float *flux = NULL;
229 float *slit = NULL;
230 char name[256];
231 FILE* datfile = NULL;
232 char *shortname = NULL;
233
234 XSH_ASSURE_NOT_NULL( rec_frame);
235
236 check( rec_name = cpl_frame_get_filename( rec_frame));
237
238 shortname = strrchr( rec_name, '/');
239
240 if (shortname != NULL){
241 rec_name = shortname+1;
242 }
243
244 check( rec_list = xsh_rec_list_load( rec_frame, instr));
245
246 check( nlambda = xsh_rec_list_get_nlambda( rec_list, iorder));
247 check( nslit = xsh_rec_list_get_nslit( rec_list, iorder));
248 check( flux = xsh_rec_list_get_data1( rec_list, iorder));
249 check( slit = xsh_rec_list_get_slit( rec_list, iorder));
250
251 sprintf( name, "%s_profil.dat",rec_name);
252 datfile = fopen( name, "w");
253 fprintf( datfile, "#slit flux\n");
254
255 for( islit=0; islit < nslit; islit++){
256 double val =0.0;
257
258 for(ilambda=0; ilambda < nlambda; ilambda++){
259 val+= flux[ilambda+islit*nlambda];
260 }
261 fprintf( datfile,"%f %f\n", slit[islit], val);
262 }
263 fclose(datfile);
264
265 cleanup:
266 xsh_rec_list_free( &rec_list);
267 return;
268}
277int main( int argc, char **argv)
278{
279 /* Declarations */
280 int ret = 0 ;
281
283
284 char *sof_name = NULL;
285 cpl_frameset *set = NULL;
286
287 const char * raw_sof_name = NULL ;
288 cpl_frameset *raw_set = NULL;
289
290 cpl_frame *sci_frame = NULL;
291 cpl_frame *orderlist_frame = NULL;
292 cpl_frame *wavesol_frame = NULL;
293 cpl_frame *model_frame = NULL;
294 cpl_frame *spectralformat_frame = NULL;
295 cpl_frame *rec_ab_frame = NULL ;
296 cpl_frame *rec_abeso_frame = NULL ;
297 cpl_frame *rec_abtab_frame = NULL ;
298 cpl_frame *rec_ba_frame = NULL ;
299 cpl_frame *rec_bashift_frame = NULL ;
300 cpl_frame *rec_bashifteso_frame = NULL ;
301 cpl_frame *loc_ab_frame = NULL;
302 cpl_frame *loc_ba_frame = NULL;
303 cpl_frameset *nod_set = NULL;
304 cpl_frameset *zero_nod_set = NULL;
305 cpl_frameset *combine_set = NULL;
306
307 cpl_frame *combine_nod_frame = NULL;
308 cpl_frame *combine_nodeso_frame = NULL;
309
310 int order_min = -1, order_max = -1;
311 int inod = 0;
312 int rec_min_index=-1, rec_max_index=-1;
313 xsh_order_list* order_list = NULL;
314 xsh_rectify_param rectify_par;
316 xsh_combine_nod_param cnod_par;
317 int nslit_c, nslit=-100;
318 int use_loc_obj = 0;
319 double slit_min_c, slit_min=-100;
321 const char *tag = NULL;
322 int i, nb_frames;
323 double *ref_ra = NULL, *ref_dec = NULL;
324 const int decode_bp=2147483647;
325 /* Initialize libraries */
327 cpl_msg_set_level(CPL_MSG_DEBUG);
329
330 /* Set rectify default params */
331 strcpy( rectify_par.rectif_kernel, "default");
332 rectify_par.kernel_type = 0 ;
333 rectify_par.rectif_radius = 4 ;
334 rectify_par.rectif_bin_lambda = 0.1 ;
335 rectify_par.rectif_bin_space = 0.1 ;
336 rectify_par.conserve_flux = FALSE;
337
338 loc_par.method = LOC_MAXIMUM_METHOD;
339 loc_par.loc_chunk_nb = 10;
340 loc_par.loc_deg_poly = 0;
341 loc_par.loc_thresh = 0.1;
342
343 HandleOptions( argc, argv, &rectify_par, &order_min, &order_max,
344 &slit_min, &nslit, &use_loc_obj, &sof_name);
345
346 if ( sof_name != NULL){
347 xsh_msg("Using nod set : %s", sof_name);
348 check( nod_set = sof_to_frameset( sof_name));
349 check( instrument = xsh_dfs_set_groups( nod_set));
351 check( nb_frames = cpl_frameset_get_size( nod_set));
352
353 for ( i = 0 ; i < nb_frames ; i++ ) {
354 check( sci_frame = cpl_frameset_get_frame( nod_set, i));
355 xsh_msg("NOD : %s", cpl_frame_get_filename( sci_frame));
356 check( analyse_rectify( sci_frame, inod, instrument));
357 }
358
359 }
360 else{
361 xsh_msg("Building nod set");
362 if ( (argc - optind) >=2 ) {
363 raw_sof_name = argv[optind];
364 sof_name = argv[optind+1];
365 }
366 else {
367 Help();
368 exit(0);
369 }
370 /* Create frameset from sof */
371 check( set = sof_to_frameset( sof_name));
372 /* Validate frame set */
375 check( spectralformat_frame = xsh_find_spectral_format( set, instrument));
376 check( orderlist_frame = xsh_find_order_tab_edges( set, instrument));
377
378 check( raw_set = sof_to_frameset( raw_sof_name));
380
381 /* Create list of_reclist */
382 check( nb_frames = cpl_frameset_get_size( raw_set));
383
384 for ( i = 0 ; i < nb_frames ; i++ ) {
385 check( sci_frame = cpl_frameset_get_frame( raw_set, i));
386 xsh_msg("SCI : %s",
387 cpl_frame_get_filename( sci_frame));
388 }
389 xsh_msg("ORDERLIST : %s",
390 cpl_frame_get_filename( orderlist_frame));
391 xsh_msg("SPECTRALFORMAT : %s",
392 cpl_frame_get_filename( spectralformat_frame));
393
394 if ( mode == XSH_MODE_SLIT){
395 wavesol_frame = xsh_find_wave_tab_2d( set, instrument);
396
397 if ( wavesol_frame == NULL){
398 model_frame = xsh_find_model_config_tab( set, instrument);
399 }
400
401 if ( wavesol_frame != NULL){
402 xsh_msg("WAVESOL : %s",
403 cpl_frame_get_filename( wavesol_frame));
404 }
405 else {
406 xsh_msg("MODEL : %s",
407 cpl_frame_get_filename( model_frame));
408 }
409 }
410
411 xsh_msg(" Parameters ");
412 xsh_msg(" kernel %s", rectify_par.rectif_kernel);
413 xsh_msg(" radius %f", rectify_par.rectif_radius);
414 xsh_msg(" bin-space %f", rectify_par.rectif_bin_space);
415 xsh_msg(" bin-lambda %f", rectify_par.rectif_bin_lambda);
416
417 check( order_list = xsh_order_list_load ( orderlist_frame, instrument));
418
419 if ( order_min != -1) {
420 check( rec_min_index = xsh_order_list_get_index_by_absorder( order_list,
421 order_min));
422 xsh_msg("Order min %d => index %d", order_min, rec_min_index);
423 }
424 else{
425 rec_min_index = 0;
426 }
427
428 if ( order_max != -1) {
429 check( rec_max_index = xsh_order_list_get_index_by_absorder( order_list,
430 order_max));
431 xsh_msg("Order max %d => index %d", order_max, rec_max_index);
432 }
433 else{
434 rec_max_index = order_list->size;
435 }
436
437
438 /* Now rectify the frame */
439 check( xsh_rec_slit_size( &rectify_par,
440 &slit_min_c, &nslit_c, mode));
441
442 if (slit_min == -100){
443 slit_min = slit_min_c;
444 }
445 if ( nslit == -100){
446 nslit = nslit_c;
447 }
448
449 xsh_msg("SLIT min = %f and has size %d", slit_min, nslit);
450
452
453 check( rec_ab_frame = xsh_rectify_orders( sci_frame, order_list,
454 wavesol_frame, model_frame, instrument, &rectify_par,
455 spectralformat_frame, NULL, "REC_A_B.fits", tag,
456 &rec_abeso_frame,&rec_abtab_frame,
457 rec_min_index, rec_max_index, slit_min, nslit, 0,NULL));
458
459 check( rec_ba_frame = xsh_rec_list_frame_invert( rec_ab_frame, tag,
460 instrument));
461 nod_set = cpl_frameset_new();
462 cpl_frameset_insert( nod_set, rec_ab_frame);
463
464 if ( use_loc_obj == 1){
465 check( loc_ab_frame = xsh_localize_obj( rec_ab_frame, NULL,instrument,
466 &loc_par, NULL, "LOC_AB.fits"));
467 check( loc_ba_frame = xsh_localize_obj( rec_ba_frame, NULL,instrument,
468 &loc_par, NULL, "LOC_BA.fits"));
469 }
470 else{
471 check( rec_bashift_frame = shift_with_kw( rec_ba_frame, instrument,
472 &rectify_par, "REC_SHIFT_B_A.fits", &rec_bashifteso_frame, &ref_ra,
473 &ref_dec, 1));
474
475 xsh_msg("TEST REF RA DEC %f %f", *ref_ra, *ref_dec);
476
477 cpl_frameset_insert( nod_set, rec_bashift_frame);
478 }
479 }
480
481 zero_nod_set = cpl_frameset_new();
482
483 /* create 0 frames */
484 for ( i = 0 ; i < nb_frames ; i++ ) {
485 cpl_frame *new_frame = NULL;
486
487 check( sci_frame = cpl_frameset_get_frame( nod_set, i));
488 check( new_frame = create_zero_rectify( sci_frame, inod, instrument));
489 check( cpl_frameset_insert( zero_nod_set, new_frame));
490 }
491
492 cnod_par.nod_clip = FALSE;
493
494 for ( i = 0 ; i < nb_frames ; i++ ) {
495 cpl_frame *analyse_frame = NULL;
496 cpl_frame *orig_frame = NULL;
497 const char * orig_name = NULL;
498 char tag[256];
499
500 combine_set = cpl_frameset_duplicate( zero_nod_set);
501 check( analyse_frame = cpl_frameset_get_frame( combine_set, i));
502 check( orig_frame = cpl_frameset_get_frame( nod_set, i));
503 check( orig_name = cpl_frame_get_filename( orig_frame));
504 check( cpl_frame_set_filename( analyse_frame, orig_name));
505
506 sprintf( tag, "COMBINE_NOD%d", i);
507 check( combine_nod_frame = xsh_combine_nod( combine_set, &cnod_par,
508 tag, instrument, &combine_nodeso_frame,0));
509 check( analyse_rectify( combine_nod_frame, inod, instrument));
510
511 xsh_free_frameset( &combine_set);
512 xsh_free_frame( &combine_nod_frame);
513 xsh_free_frame( &combine_nodeso_frame);
514 }
515
516 check( combine_nod_frame = xsh_combine_nod( nod_set, &cnod_par,
517 "FULL_COMBINE_NOD", instrument,&combine_nodeso_frame,0));
518 check( analyse_rectify( combine_nod_frame, inod, instrument));
519
520 cleanup:
521 if (cpl_error_get_code() != CPL_ERROR_NONE) {
522 xsh_error_dump(CPL_MSG_ERROR);
523 ret = 1;
524 }
525 xsh_order_list_free( &order_list);
526 xsh_free_frameset( &raw_set);
527 xsh_free_frameset( &set);
529 xsh_free_frameset( &nod_set);
530 xsh_free_frameset( &zero_nod_set);
531 xsh_free_frameset( &combine_set);
532 xsh_free_frame( &rec_abeso_frame);
533 xsh_free_frame( &rec_abtab_frame);
534 xsh_free_frame( &rec_ba_frame);
535 xsh_free_frame( &rec_bashifteso_frame);
536 xsh_free_frame( &loc_ab_frame);
537 xsh_free_frame( &loc_ba_frame);
538 xsh_free_frame( &combine_nod_frame);
539 xsh_free_frame( &combine_nodeso_frame);
540 XSH_FREE( ref_ra);
541 XSH_FREE( ref_dec);
542 TEST_END();
543 return ret;
544}
int main()
Unit test of xsh_bspline_interpol.
static const char * Options
cpl_frame * create_zero_rectify(cpl_frame *rec_frame, int iorder, xsh_instrument *instr)
static void Help(void)
static void HandleOptions(int argc, char **argv, xsh_rectify_param *rectify_par, int *order_min, int *order_max, double *slit_min, int *nslit, int *use_loc, char **nod_set_name)
#define MODULE_ID
static struct option long_options[]
void analyse_rectify(cpl_frame *rec_frame, int iorder, xsh_instrument *instr)
@ KERNEL_OPT
@ HELP_OPT
@ NOD_ORDER_OPT
@ MAX_ORDER_OPT
@ RADIUS_OPT
@ BIN_SPACE_OPT
@ NSLIT_OPT
@ MIN_ORDER_OPT
@ USELOC_OPT
@ NOD_SET_OPT
@ SLIT_MIN_OPT
@ BIN_LAMBDA_OPT
static char mode[32]
static xsh_instrument * instrument
cpl_frameset * sof_to_frameset(const char *sof_name)
Definition: tests.c:576
cpl_frame * xsh_combine_nod(cpl_frameset *nod_frames, xsh_combine_nod_param *nod_par, const char *tag, xsh_instrument *instrument, cpl_frame **res_frame_ext, const int scale_nod)
int xsh_order_list_get_index_by_absorder(xsh_order_list *list, double absorder)
xsh_order_list * xsh_order_list_load(cpl_frame *frame, xsh_instrument *instr)
load an order list from a frame
void xsh_order_list_free(xsh_order_list **list)
free memory associated to an order_list
int xsh_rec_list_get_nslit(xsh_rec_list *list, int idx)
Definition: xsh_data_rec.c:827
xsh_rec_list * xsh_rec_list_load(cpl_frame *frame, xsh_instrument *instrument)
load an rec list from a frame
Definition: xsh_data_rec.c:289
float * xsh_rec_list_get_data1(xsh_rec_list *list, int idx)
cpl_frame * xsh_rec_list_save(xsh_rec_list *list, const char *filename, const char *tag, int is_temp)
Save a rec list in a frame.
float * xsh_rec_list_get_slit(xsh_rec_list *list, int idx)
Definition: xsh_data_rec.c:884
int xsh_rec_list_get_nlambda(xsh_rec_list *list, int idx)
Definition: xsh_data_rec.c:865
cpl_frame * xsh_rec_list_frame_invert(cpl_frame *rec_frame, const char *tag, xsh_instrument *instrument)
Invert the rectified flux images of the input frame into a new frame.
Definition: xsh_data_rec.c:713
void xsh_rec_list_free(xsh_rec_list **list)
free memory associated to a rec_list
Definition: xsh_data_rec.c:760
#define check(COMMAND)
Definition: xsh_error.h:71
#define xsh_error_dump(level)
Definition: xsh_error.h:92
#define XSH_ASSURE_NOT_NULL(pointer)
Definition: xsh_error.h:99
XSH_MODE xsh_instrument_get_mode(xsh_instrument *i)
Get a mode on instrument structure.
void xsh_instrument_free(xsh_instrument **instrument)
free an instrument structure
void xsh_instrument_set_decode_bp(xsh_instrument *i, const int decode_bp)
Set bad pixel code.
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.
#define xsh_msg(...)
Print a message on info level.
Definition: xsh_msg.h:121
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_rec_slit_size(xsh_rectify_param *rectify_par, double *slit_min, int *nslit, XSH_MODE mode)
rectify frame
Definition: xsh_rectify.c:758
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
int xsh_debug_level_set(int level)
set debug level
Definition: xsh_utils.c:3125
enum localize_method method
cpl_kernel kernel_type
#define TEST_END()
Definition: tests.h:111
#define TESTS_INIT(DRL_ID)
Definition: tests.h:105
@ XSH_MODE_SLIT
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_wave_tab_2d(cpl_frameset *frames, xsh_instrument *instr)
Find a wave tab 2D.
Definition: xsh_dfs.c:3650
xsh_instrument * xsh_dfs_set_groups(cpl_frameset *set)
Set the group as RAW or CALIB in a frameset and return the instrument detected.
Definition: xsh_dfs.c:1046
cpl_frame * xsh_find_model_config_tab(cpl_frameset *frames, xsh_instrument *instr)
Find a model configuration table frame.
Definition: xsh_dfs.c:3957
#define XSH_ORDER2D
Definition: xsh_dfs.h:588
#define XSH_GET_TAG_FROM_ARM(TAG, instr)
Definition: xsh_dfs.h:1548
@ LOC_MAXIMUM_METHOD
#define XSH_FREE(POINTER)
Definition: xsh_utils.h:92
@ XSH_DEBUG_LEVEL_MEDIUM
Definition: xsh_utils.h:138