sinfoni_recipes_defaults.c

00001 /* $Id: sinfoni_recipes_defaults.c,v 1.33 2005/07/29 13:04:34 amodigli Exp $
00002  *
00003  * This file is part of the SINFONI Pipeline
00004  * Copyright (C) 2002,2003 European Southern Observatory
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  */
00020 
00021 /*
00022  * $Author: amodigli $
00023  * $Date: 2005/07/29 13:04:34 $
00024  * $Revision: 1.33 $
00025  * $Name:  $
00026  */
00027 
00028 
00029 /*-----------------------------------------------------------------------------
00030                                 Includes
00031  ----------------------------------------------------------------------------*/
00032 
00033 #include "sinfoni_recipes_defaults.h"
00034 
00035 /*---------------------------------------------------------------------------*/
00041 /*---------------------------------------------------------------------------*/
00042 
00045 /*---------------------------------------------------------------------------*/
00052 /*---------------------------------------------------------------------------*/
00053 
00054 
00055 /* --------------------------------------------------------------------------
00056    BPDIST
00057 Revised by Matthew
00058 ----------------------------------------------------------------------------*/
00059 
00060 static struct  {
00061   double    sig_fct[N_INST_SET];
00062   int       method_ind;
00063   double    factor[N_INST_SET];
00064   int       iterations[N_INST_SET];
00065   double    low_rej[N_INST_SET];
00066   double    hig_rej[N_INST_SET];
00067   int       llx[N_INST_SET];
00068   int       lly[N_INST_SET];
00069   int       urx[N_INST_SET];
00070   int       ury[N_INST_SET];
00071   int       thresh_ind;
00072   double    mean_fct[N_INST_SET];
00073   double    min_cut[N_INST_SET];
00074   double    max_cut[N_INST_SET];
00075 } par_bpdist = {
00076   /* H, H+K, K ,J */
00077 
00078   /* sig_fct    */ {2.,2.,2.,2.},  
00079   /* method_ind */ 1,
00080   /* factor     */ {999.,999.,999.,999.},  
00081   /* iterations */ {8,8,8,8},
00082   /* low_rej    */ {0.1,0.1,0.1,0.1},
00083   /* hig_rej    */ {0.1,0.1,0.1,0.1},
00084   /* llx        */ {1350,1350,1350,1350},              
00085   /* lly        */ {1000,1000,1000,1000},             
00086   /* urx        */ {1390,1390,1390,1390},          
00087   /* ury        */ {1200,1200,1200,1200},       
00088   /* thresh_ind */ 1,
00089   /* mean_fct   */ {999.,999.,999.,999.},        
00090   /* min_cut    */ {0.1,0.1,0.1,0.1}, 
00091   /* max_cut    */ {50000,50000,50000,50000}
00092 
00093 };
00094 
00095 
00096 /* --------------------------------------------------------------------------
00097    BPLIN
00098 Revised by Matthew
00099 -----------------------------------------------------------------------------*/
00100 static struct  {
00101   int       order[N_INST_SET];
00102   double    thresh_sigma_factor[N_INST_SET];
00103 
00104   double    non_lin_thresh[N_INST_SET];
00105   double    low_rej[N_INST_SET];
00106   double    hig_rej[N_INST_SET];
00107   char      coeffs_cube_name[FILE_NAME_SZ];
00108 } par_bplin = {
00109   /* H, H+K, K ,J */
00110                              /* Used for comm II */
00111   /* order                   */ {2,2,2,2},                 /* Matthew Proposal */
00112   /* threshold_sigma_factor  */ {12.,12.,12.,12},           /* {4.,4.,4.,4.} {6.0,4.,6.8,5.0}*/
00113   /* non_lin_thresh          */ {0.5,0.5,0.5,0.5},       /* {1.5,1.5,1.5,1.5} */
00114   /* low_rej                 */ {10.,10.,10.,10.},
00115   /* hig_rej                 */ {10.,10.,10.,10.},
00116   /* coeffs_cube_name        */ BP_LIN_COEFFS_CUBE_OUT_FILENAME
00117 
00118 };
00119 
00120 /* --------------------------------------------------------------------------
00121    BPNOISE
00122 -----------------------------------------------------------------------------*/
00123 
00124 static struct  {
00125   double    thresh_sigma_factor[N_INST_SET];
00126   double    low_rej[N_INST_SET];
00127   double    hig_rej[N_INST_SET];
00128 } par_bpnoise = {
00129   /* H, H+K, K ,J */
00130 
00131   /* threshold_sigma_factor  */ {10.,10.,10.,10.},  /* dfo. was {5.,5.,5.,5.} */
00132   /* low_rej                 */ {10.,10.,10.,10.},
00133   /* hig_rej                 */ {10.,10.,10.,10.}
00134 
00135 };
00136 
00137 
00138 
00139 /* --------------------------------------------------------------------------
00140    BPNORM
00141 Revised by Matthew
00142 -----------------------------------------------------------------------------*/
00143 static struct  {
00144   double    sig_fct[N_INST_SET];
00145   int       method_ind;
00146   double    factor[N_INST_SET];
00147   int       iterations[N_INST_SET];
00148   double    low_rej[N_INST_SET];
00149   double    hig_rej[N_INST_SET];
00150   int       llx[N_INST_SET];
00151   int       lly[N_INST_SET];
00152   int       urx[N_INST_SET];
00153   int       ury[N_INST_SET];
00154   int       thresh_ind;
00155   double    mean_fct[N_INST_SET];
00156   double    min_cut[N_INST_SET];
00157   double    max_cut[N_INST_SET];
00158 } par_bpnorm = {
00159   /* H, H+K, K ,J */
00160 
00161   /* sig_fct    */ {5.,5.,5.,5.},    
00162   /* method_ind */ 1,
00163   /* factor     */ {10.,10.,10.,10.},   /* {3.,3.,3.,3.} */   
00164   /* iterations */ {8,8,8,8},
00165   /* low_rej    */ {0.1,0.1,0.1,0.1},
00166   /* hig_rej    */ {0.1,0.1,0.1,0.1},
00167   /* llx        */ {270,270,270,270},     /* dfo. was {1000,1000,1000,1000} */             
00168   /* lly        */ {1000,1000,1000,1000}, /* dfo. was {1200,1200,1200,1200} */           
00169   /* urx        */ {310,310,310,310},     /* dfo. was {1350,1350,1350,1350} */         
00170   /* ury        */ {1200,1200,1200,1200}, /* dfo. was {1390,1390,1390,1390} */  
00171   /* thresh_ind */ 1,
00172   /* mean_fct   */ {100.,100.,100.,100.}, /* was 10 */         
00173   /* min_cut    */ {0.0,0.0,0.0,0.0},     /* dfo. was {0.1,0.1,0.1,0.1} */
00174   /* max_cut    */ {50000,50000,50000,50000}
00175 
00176 };
00177 
00178 
00179 
00180 /* --------------------------------------------------------------------------
00181    BPNORM
00182 Revised by Matthew
00183 -----------------------------------------------------------------------------*/
00184 static struct  {
00185   double    sig_fct[N_INST_SET];
00186   int       method_ind;
00187   double    factor[N_INST_SET];
00188   int       iterations[N_INST_SET];
00189   double    low_rej[N_INST_SET];
00190   double    hig_rej[N_INST_SET];
00191   int       llx[N_INST_SET];
00192   int       lly[N_INST_SET];
00193   int       urx[N_INST_SET];
00194   int       ury[N_INST_SET];
00195   int       thresh_ind;
00196   double    mean_fct[N_INST_SET];
00197   double    min_cut[N_INST_SET];
00198   double    max_cut[N_INST_SET];
00199 } par_bpsky = {
00200   /* H, H+K, K ,J */
00201 
00202   /* sig_fct    */ {5.,5.,5.,5.},    
00203   /* method_ind */ 1,
00204   /* factor     */ {3.,3.,3.,3.},    
00205   /* iterations */ {8,8,8,8},
00206   /* low_rej    */ {0.1,0.1,0.1,0.1},
00207   /* hig_rej    */ {0.1,0.1,0.1,0.1},
00208   /* llx        */ {1350,1350,1350,1350}, /* dfo. was {1000,1000,1000,1000} */             
00209   /* lly        */ {1000,1000,1000,1000}, /* dfo. was {1200,1200,1200,1200} */           
00210   /* urx        */ {1390,1390,1390,1390}, /* dfo. was {1350,1350,1350,1350} */         
00211   /* ury        */ {1200,1200,1200,1200}, /* dfo. was {1390,1390,1390,1390} */  
00212   /* thresh_ind */ 1,
00213   /* mean_fct   */ {10.,10.,10.,10.},         
00214   /* min_cut    */ {0.0,0.0,0.0,0.0},     /* dfo. was {0.1,0.1,0.1,0.1} */
00215   /* max_cut    */ {50000,50000,50000,50000}
00216 
00217 };
00218 
00219 
00220 /* --------------------------------------------------------------------------
00221    DARK
00222 -----------------------------------------------------------------------------*/
00223 static struct  {
00224   double    low_rej[N_INST_SET];
00225   double    hig_rej[N_INST_SET];
00226 } par_dark = {
00227   /* H, H+K, K ,J */
00228 
00229   /* low_rej                 */ {0.1,0.1,0.1,0.1},
00230   /* hig_rej                 */ {0.1,0.1,0.1,0.1}
00231 
00232 };
00233 
00234 
00235 
00236 
00237 
00238 
00239 
00240 /* --------------------------------------------------------------------------
00241    DISTORTION
00242 ---------------------------------------------------------------------------*/
00243 static struct  {
00244   /* H, H+K, K ,J */
00245 
00246   int       calib_ind;
00247   double    guess_wstart[N_INST_SET];
00248   double    guess_wdisp1[N_INST_SET];
00249   double    guess_wdisp2[N_INST_SET];
00250   double    min_diff_mean_med_col_int[N_INST_SET];
00251   int       half_width[N_INST_SET];
00252   double    sigma[N_INST_SET];
00253   double    fwhm[N_INST_SET];
00254   double    min_amp[N_INST_SET];
00255   double    max_res[N_INST_SET]; 
00256   int       n_disp_coef[N_INST_SET];
00257   int       n_coef_coef[N_INST_SET];
00258   double    sigma_fct[N_INST_SET];
00259   int       write_coef_ind;
00260   int       write_par_ind;
00261   char      out_wave_map[FILE_NAME_SZ];
00262   char      out_slit_pos[FILE_NAME_SZ];
00263   char      out_fitparams[FILE_NAME_SZ];
00264   char      out_coefflist[FILE_NAME_SZ];
00265   int       n_slitlets;
00266   int       pixel_dist[N_INST_SET];
00267   int       pixel_tol[N_INST_SET];
00268   int       wave_map_ind;
00269   int       mag_factor;
00270   int       slitpos_ind;
00271   int       fit_boltz_ind;
00272   int       fit_edge_ind;
00273   int       estimate_ind;
00274   double    low_pos;
00275   double    hig_pos;
00276   int       box_length[N_INST_SET];
00277   double    y_box[N_INST_SET];
00278   double    diff_tol[N_INST_SET];
00279   double    low_rej[N_INST_SET];
00280   double    hig_rej[N_INST_SET];
00281   int       mask_ind;
00282   int       gauss_ind;
00283   double    hw[N_INST_SET];
00284   char      out_fitsname[FILE_NAME_SZ];
00285   int       nslits;
00286   int       ns_half_width[N_INST_SET];
00287   double    nsfwhm[N_INST_SET];
00288   double    min_Diff[N_INST_SET];
00289   double    estimate_dist;
00290   double    dev_tol[N_INST_SET];
00291 
00292 
00293 
00294 } par_distortion = {
00295 
00296   /* band values revised by Matthew */   
00297   /* H, H+K, K ,J */
00298 
00299   /* calib_ind */                      1,                /* not used by Mathew */
00300   /* guess_wstart */          {1.65,1.95,2.2,1.25},
00301   /* guess_wdisp1 */          {-0.000200018796022,
00302                    -0.0005001433,
00303                    -0.000251669,
00304                    -0.0001500581},
00305   /* guess_wdisp2 */          {9.30345245287e-10,
00306                    4.567277e-9,
00307                    1.77136e-9,
00308                    5.8870678e-10},
00309   /* min_diff_mean_med_col_int */  {10.,1.,1.,1.},        /* 1-10 range gives similar res */
00310   /* half_width   */           {7,8,4,8},
00311   /* sigma        */           {2.,2.,2.,2.},
00312   /* fwhm         */           {2.83,3.,2.,2.},
00313   /* min_amp      */           {5.,2.,1.,2.},
00314   /* max_res      */           {0.5,0.5,0.5,0.5},
00315   /* n_disp_coef  */           {3,4,4,4},            /* lower deg is more robust */
00316   /* n_coef_coef  */           {2,2,2,2},            /* lower deg is more robust */
00317   /* sigma_fct    */           {1.5,1.5,1.5,1.5},
00318   /* write_coef_ind */          1,
00319   /* write_par_ind  */          1,
00320   /* out_wave_map  */          DISTORTION_OUT_FILENAME,
00321   /* out_slit_pos  */          SLITPOS_OUT_FILENAME,
00322   /* out_fitparams  */         WAVECAL_FIT_PARAMS_OUT_FILENAME,
00323   /* out_coefflist  */         COEFF_OUT_FILENAME,
00324   /* n_slitlets     */         NSLITLETS,
00325   /* pixel_dist     */         {12,12,12,12},        /* 12 till 24 almost same results */
00326   /* pixel_tol      */         {7.,5.5,12.,3.},            /* should big (more robust) and < 15 */
00327   /* wave_map_ind   */         0, 
00328   /* mag_factor     */         8,
00329   /* slitpos_ind    */         1,                    /* we like to get the slitpos */
00330   /* fit_boltz_ind  */         1,
00331   /* fit_edge_ind   */         0,                 
00332   /* estimate_ind   */         0,
00333   /* distortion evaluated ad detector's center */
00334   /* low_pos        */         DISTORTION_LOPOS,/* org {750,1110,760,980} */
00335   /* hig_pos        */         DISTORTION_HIPOS,/* org {1000,1260,900,1175} */
00336   /* box_length     */         {32,32,32,32},
00337   /* y_box          */         {2,5,5,5},
00338   /* diff_tol       */         {2,4,2,4},
00339   /* low_rej        */         {0.1,0.1,0.1,0.1},
00340   /* hig_rej        */         {0.1,0.1,0.1,0.1},
00341   /* mask_ind       */         0,
00342   /* gauss_ind      */         0,
00343   /* hw             */         {2,2,2,2},
00344   /* out_fitsname   */         DISTORTION_NS_OUT_FILENAME,
00345   /* nslits         */         NSLITLETS,
00346   /* nshalf_width   */         {4,4,4,4},
00347   /* nsfwhm         */         {2,5,2,2},
00348   /* min_diff       */         {1,5,5,5},     /* small val-> more robust, may be 2 better */
00349   /* estimate_dist  */         ESTIMATED_SLITLETS_DISTANCE,    /* estimated slit width */
00350   /* dev_tol        */         {20.,20.,20.,20.}    /* big is more robust than 20. less reliable */
00351 
00352 };
00353 
00354 
00355 
00356 
00357 /* --------------------------------------------------------------------------
00358    NST
00359 -----------------------------------------------------------------------------*/
00360 static struct  {
00361 
00362   double    low_rej[N_INST_SET];
00363   double    hig_rej[N_INST_SET];
00364   int       mask_ind;
00365   int       gauss_ind;
00366   double    hw[N_INST_SET];
00367   char      out_fitsname[FILE_NAME_SZ];
00368   int       nslits;
00369   int       half_width[N_INST_SET];
00370   double    fwhm[N_INST_SET];
00371   double    min_diff[N_INST_SET];
00372   double    estimate_dist;
00373   double    dev_tol[N_INST_SET];
00374 
00375 } par_nst = {
00376   /* H, H+K, K ,J */
00377 
00378   /* low_rej       */ {0.1,0.1,0.1,0.1},
00379   /* hig_rej       */ {0.1,0.1,0.1,0.1},
00380   /* mask_ind      */ 0,
00381   /* gauss_ind     */ 0,
00382   /* hw            */ {2,2,2,2},
00383   /* out_fitsname  */ NS_TEST_OUT_FILENAME,
00384   /* nslits        */ NSLITLETS,
00385   /* half_width    */ {4,4,4,4},
00386   /* fwhm          */ {2,5,2,2},
00387   /* min_diff      */ {1,5,5,5},
00388   /* estimate_dist */ ESTIMATED_SLITLETS_DISTANCE,
00389   /* dev_tol       */ {20.,20.,20.,20.}
00390 
00391 };
00392 
00393 
00394 
00395 
00396 /* --------------------------------------------------------------------------
00397    STACKED
00398 ---------------------------------------------------------------------------*/
00399 
00400 
00401 static struct  {
00402   double    low_rej[N_INST_SET];
00403   double    hig_rej[N_INST_SET];
00404   int       flat_ind;
00405   int       mask_ind;
00406   int       ind_ind;
00407   int       max_rad[N_INST_SET];
00408   double    sig_fct[N_INST_SET];
00409   int       warp_fix_ind;
00410   char      warp_fix_kernel[FILE_NAME_SZ];
00411   int       int_ind;
00412   int       nrow[N_INST_SET];
00413   int       gauss_ind;
00414   int       half_width[N_INST_SET];
00415   int       shift_frm_ind;
00416   int       shift_frm_type;
00417   int       shift_frm_ord;
00418 
00419 
00420 } par_stack_find_distortion = {
00421 
00422   /* H, H+K, K ,J */
00423 
00424   /* low_rej          */ {0.1,0.1,0.1,0.1},
00425   /* hig_rej          */ {0.1,0.1,0.1,0.1},
00426   /* flat_ind         */ 0,
00427   /* mask_ind         */ 0,
00428   /* ind_ind          */ 0,
00429   /* max_rad          */ {3,3,3,3},
00430   /* sig_fct          */ {3.0,3.0,3.0,3.0},
00431   /* warp_fix_ind     */ 0,
00432   /* warp_fix_kernel  */ "tanh",
00433   /* int_ind          */ 0,
00434   /* nrow             */ {400,400,400,400},
00435   /* gauss_ind        */ 0,
00436   /* half_width       */ {2,2,2,2},
00437   /* shift_frm_ind    */ 0,
00438   /* shift_frm_type   */ 1,
00439   /* shift_frm_ord    */ 2
00440 
00441 };
00442 
00443 
00444 
00445 static struct  {
00446   double    low_rej[N_INST_SET];
00447   double    hig_rej[N_INST_SET];
00448   int       flat_ind;
00449   int       mask_ind;
00450   int       ind_ind;
00451   int       max_rad[N_INST_SET];
00452   double    sig_fct[N_INST_SET];
00453   int       warp_fix_ind;
00454   char      warp_fix_kernel[FILE_NAME_SZ];
00455   int       int_ind;
00456   int       nrow[N_INST_SET];
00457   int       gauss_ind;
00458   int       half_width[N_INST_SET];
00459   int       shift_frm_ind;
00460   int       shift_frm_type;
00461   int       shift_frm_ord;
00462 
00463 
00464 } par_stack_wcal = {
00465 
00466   /* H, H+K, K ,J */
00467 
00468   /* low_rej          */ {0.1,0.1,0.1,0.1},
00469   /* hig_rej          */ {0.1,0.1,0.1,0.1},
00470   /* flat_ind         */ 1,
00471   /* mask_ind         */ 1,
00472   /* ind_ind          */ 0,
00473   /* max_rad          */ {4,4,4,4},
00474   /* sig_fct          */ {3.0,3.0,3.0,3.0},
00475   /* warp_fix_ind     */ 1,
00476   /* warp_fix_kernel  */ "tanh",
00477   /* int_ind          */ 0,
00478   /* nrow             */ {400,400,400,400},
00479   /* gauss_ind        */ 0,
00480   /* half_width       */ {2,2,2,2},
00481   /* shift_frm_ind    */ 0,
00482   /* shift_frm_type   */ 1,
00483   /* shift_frm_ord    */ 2
00484 
00485 };
00486 
00487 static struct  {
00488   double    low_rej[N_INST_SET];
00489   double    hig_rej[N_INST_SET];
00490   int       flat_ind;
00491   int       mask_ind;
00492   int       ind_ind;
00493   int       max_rad[N_INST_SET];
00494   double    sig_fct[N_INST_SET];
00495   int       warp_fix_ind;
00496   char      warp_fix_kernel[FILE_NAME_SZ];
00497   int       int_ind;
00498   int       nrow[N_INST_SET];
00499   int       gauss_ind;
00500   int       half_width[N_INST_SET];
00501   int       shift_frm_ind;
00502   int       shift_frm_type;
00503   int       shift_frm_ord;
00504 
00505 
00506 } par_stack_lampspec = {
00507 
00508 
00509   /* H, H+K, K ,J */
00510 
00511   /* low_rej          */ {0.1,0.1,0.1,0.1},
00512   /* hig_rej          */ {0.1,0.1,0.1,0.1},
00513   /* flat_ind         */ 0,
00514   /* mask_ind         */ 0,
00515   /* ind_ind          */ 0,
00516   /* max_rad          */ {4,4,4,4},
00517   /* sig_fct          */ {3.0,3.0,3.0,3.0},
00518   /* warp_fix_ind     */ 0,
00519   /* warp_fix_kernel  */ "tanh",
00520   /* int_ind          */ 0,
00521   /* nrow             */ {400,400,400,400},
00522   /* gauss_ind        */ 0,
00523   /* half_width       */ {2,2,2,2},
00524   /* shift_frm_ind    */ 0,
00525   /* shift_frm_type   */ 1,
00526   /* shift_frm_ord    */ 2
00527 
00528 };
00529 
00530 
00531 static struct  {
00532   double    low_rej[N_INST_SET];
00533   double    hig_rej[N_INST_SET];
00534   int       flat_ind;
00535   int       mask_ind;
00536   int       ind_ind;
00537   int       max_rad[N_INST_SET];
00538   double    sig_fct[N_INST_SET];
00539   int       warp_fix_ind;
00540   char      warp_fix_kernel[FILE_NAME_SZ];
00541   int       int_ind;
00542   int       nrow[N_INST_SET];
00543   int       gauss_ind;
00544   int       half_width[N_INST_SET];
00545   int       shift_frm_ind;
00546   int       shift_frm_type;
00547   int       shift_frm_ord;
00548 
00549 
00550 } par_stack_sci = {
00551 
00552   /* H, H+K, K ,J */
00553 
00554   /* low_rej          */ {0.1,0.1,0.1,0.1},
00555   /* hig_rej          */ {0.1,0.1,0.1,0.1},
00556   /* flat_ind         */ 1,
00557   /* mask_ind         */ 1,
00558   /* ind_ind          */ 0,
00559   /* max_rad          */ {4,4,4,4},
00560   /* sig_fct          */ {3.0,3.0,3.0,3.0},
00561   /* warp_fix_ind     */ 1,
00562   /* warp_fix_kernel  */ "tanh",
00563   /* int_ind          */ 0,
00564   /* nrow             */ {400,400,400,400},
00565   /* gauss_ind        */ 0,
00566   /* half_width       */ {2,2,2,2},
00567   /* shift_frm_ind    */ 0,
00568   /* shift_frm_type   */ 1,
00569   /* shift_frm_ord    */ 2
00570 
00571 };
00572 
00573 
00574 
00575 /* --------------------------------------------------------------------------
00576    WCAL
00577 ---------------------------------------------------------------------------*/
00578 static struct  {
00579   int       calib_ind;
00580   double    guess_wstart[N_INST_SET];
00581   double    guess_wdisp1[N_INST_SET];
00582   double    guess_wdisp2[N_INST_SET];
00583   double    min_diff[N_INST_SET];
00584   int       half_width[N_INST_SET];
00585   double    sigma[N_INST_SET];
00586   double    fwhm[N_INST_SET];
00587   double    min_amp[N_INST_SET];
00588   double    max_res[N_INST_SET]; 
00589   int       n_disp_coef[N_INST_SET];
00590   int       n_coef_coef[N_INST_SET];
00591   double    sigma_fct[N_INST_SET];
00592   int       write_coef_ind;
00593   int       write_par_ind;
00594   char      out_wave_map[FILE_NAME_SZ];
00595   char      out_slit_pos[FILE_NAME_SZ];
00596   char      out_fitparams[FILE_NAME_SZ];
00597   char      out_coefflist[FILE_NAME_SZ];
00598   int       n_slitlets;
00599   int       pixel_dist[N_INST_SET];
00600   int       pixel_tol[N_INST_SET];
00601   int       wave_map_ind;
00602   int       mag_factor;
00603   int       slitpos_ind;
00604   int       fit_boltz_ind;
00605   int       fit_edge_ind;
00606   int       estimate_ind;
00607   double    low_pos[N_INST_SET];
00608   double    hig_pos[N_INST_SET];
00609   int       box_length[N_INST_SET];
00610   double    y_box[N_INST_SET];
00611   double    diff_tol[N_INST_SET];
00612 
00613 } par_wcal = {
00614 
00615   /* H, H+K, K ,J */
00616 
00617   /* calib_ind */                      1,
00618   /* guess_wstart */          {1.65,1.95,2.2,1.25},
00619   /* guess_wdisp1 */          {-0.000200018796022,
00620                    -0.0005001433,
00621                    -0.000251669,
00622                    -0.0001500581},
00623   /* guess_wdisp2 */          {9.30345245287e-10,
00624                    4.567277e-9,
00625                    1.77136e-9,
00626                    5.8870678e-10},
00627   /* min_diff     */ {10.,1.,1.,1.},
00628   /* half_width   */           {7,8,4,8},
00629   /* sigma        */           {2.,2.,2.,2.},
00630   /* fwhm         */           {2.83,3.,2.,2.},
00631   /* min_amp      */           {5.,2.,1.,2.},
00632   /* max_res      */           {0.5,0.5,0.5,0.5},
00633   /* n_disp_coef  */           {3,4,4,4},
00634   /* n_coef_coef  */           {2,2,2,2},
00635   /* sigma_fct    */           {1.5,1.5,1.5,1.5},
00636   /* write_coef_ind */          1,
00637   /* write_par_ind  */          1,
00638   /* out_wave_map  */          WAVECAL_OUT_FILENAME,
00639   /* out_slit_pos  */          SLITPOS_OUT_FILENAME,
00640   /* out_fitparams  */         WAVECAL_FIT_PARAMS_OUT_FILENAME,
00641   /* out_coefflist  */         COEFF_OUT_FILENAME,
00642   /* n_slitlets     */         NSLITLETS,
00643   /* pixel_dist     */         {12,12,12,12},
00644   /* pixel_tol      */         {7,5.5,12,3},
00645   /* wave_map_ind   */         0, 
00646   /* mag_factor     */         8,
00647   /* slitpos_ind    */         1,                    
00648   /* fit_boltz_ind  */         1,
00649   /* fit_edge_ind   */         0,
00650   /* estimate_ind   */         0,
00651   /* low_pos        */         {750,1110,760,980},  /* H 750 */
00652   /* hig_pos        */         {1000,1260,900,1175}, /* H 1000 */
00653   /* box_length     */         {32,32,32,32},
00654   /* y_box          */         {2,5,5,5}, /* {2,5,5,5} */
00655   /* diff_tol       */         {2,4,2,4}  /* H+K was 4 */
00656 
00657 };
00658 
00659 
00660 
00661 
00662 
00663 /* --------------------------------------------------------------------------
00664    PSF
00665 ---------------------------------------------------------------------------*/
00666 static struct  {
00667 
00668 
00669         char out_name[FILENAMESZ] ;   
00670         float low_rej[N_INST_SET] ;
00671         float hig_rej[N_INST_SET] ;
00672         int north_south_ind  ;
00673         int n_slits ;
00674     char  method[1] ;
00675         int order[N_INST_SET] ;
00676 
00677  
00678 } par_psf = {
00679 
00680   /* H, H+K, K ,J */
00681 
00682   /* out_name        */ PSF_OUT_FILENAME,   
00683   /* low_reject      */ {0.1,0.1,0.1,0.1}, 
00684   /* hig_reject      */ {0.1,0.1,0.1,0.1}, 
00685   /* north_south_ind */ 0,
00686   /* n_slits         */ NSLITLETS,
00687   /* method[1]       */ "P",
00688   /* order           */ {2,2,2,2}
00689 
00690 
00691 };
00692 
00693 
00694 
00695 /* --------------------------------------------------------------------------
00696    FOCUS
00697 ---------------------------------------------------------------------------*/
00698 static struct  {
00699  
00700         char out_name[FILENAMESZ] ;     
00701         float low_rej[N_INST_SET] ;
00702         float hig_rej[N_INST_SET] ;
00703         int north_south_ind  ;
00704         int n_slits ;
00705     char  method[1] ;
00706         int order[N_INST_SET] ;
00707         int llx[N_INST_SET] ;
00708         int lly [N_INST_SET];
00709         int halfbox_x[N_INST_SET] ;
00710         int halfbox_y[N_INST_SET] ;
00711         int mpar0[N_INST_SET] ;
00712         int mpar1[N_INST_SET] ;
00713         int mpar2[N_INST_SET] ; 
00714         int mpar3[N_INST_SET] ; 
00715         int mpar4[N_INST_SET] ; 
00716         int mpar5[N_INST_SET] ; 
00717         int mpar6[N_INST_SET] ; 
00718         char fit_list[FILENAMESZ] ;
00719         int plot_gauss_ind ;
00720         char gauss_plot_name[FILENAMESZ] ;
00721 
00722 } par_focus = {
00723 
00724   /* H, H+K, K ,J */
00725 
00726   /* out_name */               FOCUS_OUT_FILENAME,     
00727   /* low_rej  */               {0.1,0.1,0.1,0.1},            
00728   /* hig_rej  */               {0.1,0.1,0.1,0.1}, 
00729   /* north_south_ind  */       1,
00730   /* n_slits          */       NSLITLETS,
00731   /* method           */       "P",
00732   /* order            */       {2,2,2,2},
00733   /* llx              */       {9,9,9,9},
00734   /* lly              */       {9,9,9,9},
00735   /* halfbox_x        */       {7,7,7,7},
00736   /* halfbox_y        */       {7,7,7,7},
00737   /* mpar0            */       {1,1,1,1},
00738   /* mpar1            */       {1,1,1,1},
00739   /* mpar2            */       {1,1,1,1},
00740   /* mpar3            */       {1,1,1,1},
00741   /* mpar4            */       {1,1,1,1},
00742   /* mpar5            */       {1,1,1,1},
00743   /* mpar6            */       {1,1,1,1},
00744   /* fit_list         */       FOCUS_FITPAR_OUT_FILENAME,
00745   /* plot_gauss_ind   */       1,
00746   /* gauss_plot_name  */       FOCUS_GAUSSPLOT_OUT_FILENAME
00747 
00748 
00749 };
00750 
00751 
00752 
00753 
00754 
00755 /* --------------------------------------------------------------------------
00756    WCAL
00757 ---------------------------------------------------------------------------*/
00758 static struct  {
00759   double    low_rej[N_INST_SET];
00760   double    hig_rej[N_INST_SET];
00761   int       flat_ind;
00762   int       mask_ind;
00763   int       ind_ind;
00764   int       max_rad[N_INST_SET];
00765   double    sig_fct[N_INST_SET];
00766   int       warp_fix_ind;
00767   char      warp_fix_kernel[FILE_NAME_SZ];
00768   int       int_ind;
00769   int       nrow[N_INST_SET];
00770   int       gauss_ind;
00771   int       half_width[N_INST_SET];
00772   int       shift_frm_ind;
00773   int       shift_frm_type;
00774   int       shift_frm_ord;
00775 
00776 
00777 } par_stack_focus = {
00778   /* H, H+K, K ,J */
00779 
00780   /* low_rej          */ {0.1,0.1,0.1,0.1},
00781   /* hig_rej          */ {0.1,0.1,0.1,0.1},
00782   /* flat_ind         */ 1,
00783   /* mask_ind         */ 1,
00784   /* ind_ind          */ 0,
00785   /* max_rad          */ {4,4,4,4},
00786   /* sig_fct          */ {3.0,3.0,3.0,3.0},
00787   /* warp_fix_ind     */ 1,
00788   /* warp_fix_kernel  */ "tanh",
00789   /* int_ind          */ 0,
00790   /* nrow             */ {400,400,400,400},
00791   /* gauss_ind        */ 0,
00792   /* half_width       */ {2,2,2,2},
00793   /* shift_frm_ind    */ 0,
00794   /* shift_frm_type   */ 1,
00795   /* shift_frm_ord    */ 2
00796 
00797 };
00798 
00799 
00800 
00801 
00802 static struct  {
00803   double    low_rej[N_INST_SET];
00804   double    hig_rej[N_INST_SET];
00805   int       flat_ind;
00806   int       mask_ind;
00807   int       ind_ind;
00808   int       max_rad[N_INST_SET];
00809   double    sig_fct[N_INST_SET];
00810   int       warp_fix_ind;
00811   char      warp_fix_kernel[FILE_NAME_SZ];
00812   int       int_ind;
00813   int       nrow[N_INST_SET];
00814   int       gauss_ind;
00815   int       half_width[N_INST_SET];
00816   int       shift_frm_ind;
00817   int       shift_frm_type;
00818   int       shift_frm_ord;
00819 
00820 
00821 } par_stack_psf = {
00822   /* H, H+K, K ,J */
00823 
00824   /* low_rej          */ {0.1,0.1,0.1,0.1},
00825   /* hig_rej          */ {0.1,0.1,0.1,0.1},
00826   /* flat_ind         */ 1,
00827   /* mask_ind         */ 1,
00828   /* ind_ind          */ 0,
00829   /* max_rad          */ {4,4,4,4},
00830   /* sig_fct          */ {3.0,3.0,3.0,3.0},
00831   /* warp_fix_ind     */ 1,
00832   /* warp_fix_kernel  */ "tanh",
00833   /* int_ind          */ 0,
00834   /* nrow             */ {400,400,400,400},
00835   /* gauss_ind        */ 0,
00836   /* half_width       */ {2,2,2,2},
00837   /* shift_frm_ind    */ 0,
00838   /* shift_frm_type   */ 1,
00839   /* shift_frm_ord    */ 2
00840 
00841 };
00842 
00843 
00844 /* --------------------------------------------------------------------------
00845    CUBECREATE
00846 ---------------------------------------------------------------------------*/
00847 static struct  {
00848 
00849         char out_name[FILE_NAME_SZ] ; 
00850         int n_coeffs [N_INST_SET];      
00851         int halo_correct_ind ;
00852         int north_south_ind  ;
00853         int n_slits ;
00854     char  method [1];
00855         int order [N_INST_SET];
00856 
00857 
00858 } par_cubecreate = {
00859 
00860   /* H, H+K, K ,J */
00861 
00862   /* out_name         */ QCFLAT_OUT_FILENAME, 
00863   /* n_coeffs         */ {3,3,3,3},      
00864   /* halo_correct_ind */ 0,
00865   /* north_south_ind  */ 1,
00866   /* nslits           */ NSLITLETS,
00867   /* method           */ "P",
00868   /* order            */ {2,2,2,2}
00869 
00870 };
00871 
00872 
00873 /* --------------------------------------------------------------------------
00874    LAMPFLAT
00875 ---------------------------------------------------------------------------*/
00876 static struct  {
00877 
00878         float low_rej [N_INST_SET];      
00879         float hig_rej [N_INST_SET] ;
00880         int interpol_ind ;
00881         char mask[FILE_NAME_SZ] ;
00882         int max_rad[N_INST_SET] ;
00883         int bad_ind ;
00884         char mask_name[FILE_NAME_SZ] ;
00885         float sigma_factor[N_INST_SET] ;
00886 
00887         float factor[N_INST_SET] ;
00888         int iterations ;
00889         float bad_low_rej[N_INST_SET] ;
00890         float bad_hig_rej[N_INST_SET] ;
00891         int llx[N_INST_SET] ;
00892         int lly[N_INST_SET] ;
00893         int urx[N_INST_SET] ;
00894         int ury [N_INST_SET] ;
00895         int thresh_ind ;
00896         float mean_factor[N_INST_SET] ;
00897 
00898 } par_lampflat = {
00899 
00900   /* H, H+K, K ,J */
00901 
00902   /* low_rej      */   {0.1,0.1,0.1,0.1},   
00903   /* hig_rej      */   {0.1,0.1,0.1,0.1}, 
00904   /* interpol_ind */   0,             /* if 0 the next 2 par does not count */
00905   /* mask         */   LAMP_FLATS_OUT_BPMAP,
00906   /* max_rad      */   {4,4,4,4},
00907   /* bad_Ind      */   0,             /* if 0 all the rest does not matter */
00908   /* mask_name    */   LAMP_FLATS_OUT_BPMAP,
00909   /* sigma_factor */   {5.,5.,5.,5.},
00910 
00911   /* factor */         {3.,3.,3.,3.},
00912   /* iterations */     8,
00913   /* bad_low_rej */    {10.,10.,10.,10.},
00914   /* bad_hig_rej */    {10.,10.,10.,10.},
00915   /* llx */            {1350,1350,1350,1350},  /* dfo. was {1000,1000,1000,1000} */
00916   /* lly */            {1000,1000,1000,1000}, /* dfo. was {1200,1200,1200,1200} */
00917   /* urx */            {1390,1390,1390,1390}, /* dfo. was {1350,1350,1350,1350} */
00918   /* ury */            {1200,1200,1200,1200}, /* dfo. was {1390,1390,1390,1390} */
00919   /* thresh_ind */     1,                 /* we apply some threshold */
00920   /* mean_factor */    {10.,10.,10.,10.}
00921 
00922 
00923 };
00924 
00925 
00926 
00927 /* --------------------------------------------------------------------------
00928    LAMPSPEC
00929 ---------------------------------------------------------------------------*/
00930 
00931 static struct  {
00932 
00933         char out_name[FILENAMESZ] ; 
00934         int ncoeffs [N_INST_SET];
00935         float low_rej [N_INST_SET];      
00936         float hig_rej [N_INST_SET];
00937         float counts_to_intensity[N_INST_SET] ;
00938 
00939 
00940 
00941 } par_lampspec = {
00942 
00943   /* H, H+K, K ,J */
00944 
00945   /* out_name            */  LAMPSPEC_OUT_FILENAME, 
00946   /* ncoeffs             */  {3,3,3,3},
00947   /* low_rej             */  {0.1,0.1,0.1,0.1},    
00948   /* hig_rej             */  {0.1,0.1,0.1,0.1},
00949   /* counts_to_intensity */  {1.,1.,1.,1.}
00950 
00951 };
00952 
00953 
00954 
00955 /* --------------------------------------------------------------------------
00956    TWIFLAT
00957 ---------------------------------------------------------------------------*/
00958 
00959 
00960 static struct  {
00961 
00962         char out_name[FILENAMESZ] ; 
00963         int warp_fix_ind ;
00964         char kernel[FILENAMESZ] ;
00965         float low_rej[N_INST_SET] ;      
00966         float hig_rej[N_INST_SET] ;
00967 
00968 } par_twiflat = {
00969 
00970   /* H, H+K, K ,J */
00971 
00972   /* out_name     */ TWIFLAT_OUT_FILENAME,
00973   /* warp_fix_ind */ 1,
00974   /* kernel       */ "tanh", 
00975   /* low_rej      */ {0.1,0.1,0.1,0.1},     
00976   /* hig_rej      */ {0.1,0.1,0.1,0.1}
00977 
00978 
00979 };
00980 
00981 /* --------------------------------------------------------------------------
00982    OBJNOD
00983 ---------------------------------------------------------------------------*/
00984 
00985 static struct  {
00986 
00987         char out_name[FILE_NAME_SZ] ; 
00988         int jitter_ind ;  
00989         int size_x[N_INST_SET] ;
00990         int size_y[N_INST_SET] ;
00991         char kernel_type[FILE_NAME_SZ] ;
00992         char mask_name[FILE_NAME_SZ] ;
00993         int n_coeffs[N_INST_SET] ;      
00994         int halo_correct_ind ;
00995         int north_south_ind  ;
00996         int n_slits ;
00997     char  method[1] ;
00998         int order ;
00999     float  low_rej[N_INST_SET] ;
01000         float  hig_rej[N_INST_SET] ;
01001         int    tol[N_INST_SET] ;
01002 
01003 
01004 } par_objnod = {
01005 
01006   /* H, H+K, K ,J */
01007 
01008   /* out_name         */ OBJNOD_OUT_FILENAME, 
01009   /* jitter_ind       */ 1,
01010   /* size_x           */ {0,0,0,0},   /* 0 ==> automatic setting */
01011   /* size_y           */ {0,0,0,0},
01012   /* kernel_type      */ "tanh",
01013   /* mask_name        */ OBJNOD_OUT_BPMAP,
01014   /* n_coeffs         */ {3,3,3,3},      
01015   /* halo_correct_ind */ 0,
01016   /* north_south_ind  */ 1,
01017   /* n_slits          */ NSLITLETS,
01018   /* method[1]        */ "P",
01019   /* order            */ 2,
01020   /* low_rej          */ {10.,10.,10.,10.},
01021   /* hig_rej          */ {10.,10.,10.,10.},
01022   /* tol              */ {2,2,2,2}
01023 };
01024 
01025 
01026 
01027 /* --------------------------------------------------------------------------
01028    OBJSPIDER
01029 ---------------------------------------------------------------------------*/
01030 
01031 static struct  {
01032 
01033         char out_name[FILE_NAME_SZ] ; 
01034         int jitter_ind ;  
01035         int size_x[N_INST_SET] ;
01036         int size_y[N_INST_SET] ;
01037         char kernel_type[FILE_NAME_SZ] ;
01038         char mask_name[FILE_NAME_SZ] ;
01039         int n_coeffs[N_INST_SET] ;      
01040         int halo_correct_ind ;
01041         int north_south_ind  ;
01042         int n_slits ;
01043     char  method[1] ;
01044         int order ;
01045     float  low_rej[N_INST_SET] ;
01046         float  hig_rej[N_INST_SET] ;
01047         int    tol[N_INST_SET] ;
01048 
01049 
01050 } par_objspider = {
01051 
01052   /* H, H+K, K ,J */
01053 
01054   /* out_name         */ SKYSPIDER_OUT_FILENAME, 
01055   /* jitter_ind       */ 0,
01056   /* size_x           */ {0,0,0,0}, /* 0 ==> automatic setting */
01057   /* size_y           */ {0,0,0,0},
01058   /* kernel_type      */ "tanh",
01059   /* mask_name        */ SKYSPIDER_MASK_OUT_FILENAME,
01060   /* n_coeffs         */ {3,3,3,3},      
01061   /* halo_correct_ind */ 0,
01062   /* north_south_ind  */ 1,
01063   /* n_slits          */ NSLITLETS,
01064   /* method[1]        */ "P",
01065   /* order            */ 2,
01066   /* low_rej          */ {10.,10.,10.,10.},
01067   /* hig_rej          */ {10.,10.,10.,10.},
01068   /* tol              */ {2,2,2,2}
01069 
01070 
01071 };
01072 
01073 
01074 
01075 /* --------------------------------------------------------------------------
01076    STDSTAR
01077 ---------------------------------------------------------------------------*/
01078 
01079 static struct  {
01080 
01081         char out_name[FILE_NAME_SZ] ;    
01082         float low_rej[N_INST_SET] ;
01083         float hig_rej[N_INST_SET] ;
01084         int llx[N_INST_SET] ;
01085         int lly[N_INST_SET] ;
01086         int halfbox_x[N_INST_SET] ;
01087         int halfbox_y[N_INST_SET] ;
01088         float fwhm_factor[N_INST_SET] ;
01089         float back_variance ;
01090         float sky ;
01091         float gain ;
01092         int conv_ind ;      
01093         char conv_name[FILE_NAME_SZ] ;      
01094         float mag ;      
01095 
01096 } par_stdstar = {
01097 
01098   /* H, H+K, K ,J */
01099 
01100   /* out_name      */ STDSTAR_OUT_FILENAME,    
01101   /* low_rej       */ {0.1,0.1,0.1,0.1},
01102   /* hig_rej       */ {0.1,0.1,0.1,0.1},
01103   /* llx           */ {8,8,8,8},
01104   /* lly           */ {8,8,8,8},
01105   /* halfbox_x     */ {16,16,16,16},
01106   /* halfbox_y     */ {16,16,16,16},
01107   /* fwhm_factor   */ {2.0,2.0,2.0,2.0},
01108   /* back_variance */ BKG_VARIANCE, /* was 1.0 */
01109   /* sky           */ SKY_FLUX, /* ws 0, then 1.3 */
01110   /* gain          */ GAIN, /* was 2.86 */
01111   /* conv_ind      */ 1,      
01112   /* conv_name     */ STDSTAR_CONV_OUT_FILENAME,   
01113   /* mag           */ MAGNITUDE
01114 
01115 };
01116 
01117 
01118 void rec_bp_dist_set(bad_config* cfg, cpl_parameterlist* cpl_cfg, int is)
01119 {
01120 
01121    cpl_parameter* p=NULL;
01122    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_dist.sigma_factor");
01123    cfg -> sigmaFactor =  par_bpdist.sig_fct[is];
01124 
01125    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_dist.method_index");
01126    cfg -> methodInd =  par_bpdist.method_ind;
01127 
01128    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_dist.factor");
01129    cfg -> factor = par_bpdist.factor[is];
01130 
01131    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_dist.iterations");
01132    cfg -> iterations = par_bpdist.iterations[is];
01133 
01134    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_dist.low_rejection");
01135    cfg -> loReject = par_bpdist.low_rej[is];
01136 
01137    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_dist.high_rejection");
01138    cfg -> hiReject = par_bpdist.hig_rej[is];
01139 
01140    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_dist.llx");
01141    cfg -> llx = par_bpdist.llx[is];
01142 
01143    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_dist.lly");
01144    cfg -> lly =  par_bpdist.lly[is];
01145 
01146    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_dist.urx");
01147    cfg -> urx = par_bpdist.urx[is];
01148 
01149    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_dist.ury");
01150    cfg -> ury = par_bpdist.ury[is];
01151 
01152    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_dist.threshold_index");
01153    cfg -> threshInd  =  par_bpdist.thresh_ind;
01154 
01155    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_dist.mean_factor");
01156    cfg -> meanfactor = par_bpdist.mean_fct[is];
01157 
01158    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_dist.min_cut");
01159    cfg -> mincut = par_bpdist.min_cut[is];
01160 
01161    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_dist.max_cut");
01162    cfg -> maxcut = par_bpdist.max_cut[is];
01163    
01164 }
01165 
01166 void rec_bp_norm_set(bad_config* cfg, cpl_parameterlist* cpl_cfg, int is)
01167 {
01168 
01169    cpl_parameter* p=NULL;
01170    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_norm.sigma_factor");
01171    cfg -> sigmaFactor =  par_bpnorm.sig_fct[is];
01172 
01173    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_norm.method_index");
01174    cfg -> methodInd =  par_bpnorm.method_ind;
01175 
01176    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_norm.factor");
01177    cfg -> factor = par_bpnorm.factor[is];
01178 
01179    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_norm.iterations");
01180    cfg -> iterations = par_bpnorm.iterations[is];
01181 
01182    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_norm.low_rejection");
01183    cfg -> loReject = par_bpnorm.low_rej[is];
01184 
01185    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_norm.high_rejection");
01186    cfg -> hiReject = par_bpnorm.hig_rej[is];
01187 
01188    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_norm.llx");
01189    cfg -> llx = par_bpnorm.llx[is];
01190 
01191    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_norm.lly");
01192    cfg -> lly =  par_bpnorm.lly[is];
01193 
01194    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_norm.urx");
01195    cfg -> urx = par_bpnorm.urx[is];
01196 
01197    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_norm.ury");
01198    cfg -> ury = par_bpnorm.ury[is];
01199 
01200    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_norm.threshold_index");
01201    cfg -> threshInd  =  par_bpnorm.thresh_ind;
01202 
01203    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_norm.mean_factor");
01204    cfg -> meanfactor = par_bpnorm.mean_fct[is];
01205 
01206    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_norm.min_cut");
01207    cfg -> mincut = par_bpnorm.min_cut[is];
01208 
01209    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_norm.max_cut");
01210    cfg -> maxcut = par_bpnorm.max_cut[is];
01211    
01212 }
01213 
01214 
01215 
01216 void rec_bp_sky_set(badsky_config* cfg, cpl_parameterlist* cpl_cfg, int is)
01217 {
01218 
01219    cpl_parameter* p=NULL;
01220    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_sky.sigma_factor");
01221    cfg -> sigmaFactor =  par_bpsky.sig_fct[is];
01222 
01223    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_sky.method_index");
01224    cfg -> methodInd =  par_bpsky.method_ind;
01225 
01226    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_sky.factor");
01227    cfg -> factor = par_bpsky.factor[is];
01228 
01229    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_sky.iterations");
01230    cfg -> iterations = par_bpsky.iterations[is];
01231 
01232    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_sky.low_rejection");
01233    cfg -> loReject = par_bpsky.low_rej[is];
01234 
01235    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_sky.high_rejection");
01236    cfg -> hiReject = par_bpsky.hig_rej[is];
01237 
01238    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_sky.llx");
01239    cfg -> llx = par_bpsky.llx[is];
01240 
01241    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_sky.lly");
01242    cfg -> lly =  par_bpsky.lly[is];
01243 
01244    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_sky.urx");
01245    cfg -> urx = par_bpsky.urx[is];
01246 
01247    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_sky.ury");
01248    cfg -> ury = par_bpsky.ury[is];
01249 
01250    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_sky.threshold_index");
01251    cfg -> threshInd  =  par_bpsky.thresh_ind;
01252 
01253    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_sky.mean_factor");
01254    cfg -> meanfactor = par_bpsky.mean_fct[is];
01255 
01256    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_sky.min_cut");
01257    cfg -> mincut = par_bpsky.min_cut[is];
01258 
01259    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_sky.max_cut");
01260    cfg -> maxcut = par_bpsky.max_cut[is];
01261    
01262 }
01263 
01264 
01265 
01266 void rec_bp_noise_set(detnoise_config* cfg, cpl_parameterlist* cpl_cfg, int is)
01267 {
01268 
01269    cpl_parameter *p=NULL;   
01270 
01271    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_noise.low_rejection");
01272    cfg -> loReject = par_bpnoise.low_rej[is];
01273 
01274    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_noise.high_rejection");
01275    cfg -> hiReject = par_bpnoise.hig_rej[is];
01276 
01277    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.bp_noise.thresh_sigma_factor");
01278    cfg->threshSigmaFactor =  par_bpnoise.thresh_sigma_factor[is];
01279 
01280 
01281 
01282 }
01283 void rec_bp_lin_set(detlin_config* cfg, cpl_parameterlist* cpl_cfg, int is)
01284 {
01285    cpl_parameter *p=NULL;     
01286 
01287    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_lin.order");
01288    cfg -> order = par_bplin.order[is];
01289  
01290    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.bp_lin.thresh_sigma_factor");
01291    cfg->threshSigmaFactor =  par_bplin.thresh_sigma_factor[is];
01292 
01293    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_lin.low_rejection");
01294    cfg -> loReject =  par_bplin.low_rej[is];
01295 
01296    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.bp_lin.high_rejection");
01297    cfg -> hiReject =  par_bplin.hig_rej[is];
01298 
01299    /* AMO: *********************** */
01300    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.bp_lin.nlin_threshold");
01301    cfg->nonlinearThresh = (float) cpl_parameter_get_double(p);
01302 
01303    /* name of the data cube storing the found polynomial coefficients */
01304    strcpy(cfg->coeffsCubeName, BP_LIN_COEFFS_CUBE_OUT_FILENAME);
01305 
01306    strcpy(cfg -> outName, BP_LIN_OUT_FILENAME);
01307 }
01308 
01309 void rec_dark_set(dark_config* cfg, cpl_parameterlist* cpl_cfg, int is)
01310 {
01311   cpl_parameter *p=NULL; 
01312    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.dark.low_rejection");
01313    cfg -> lo_reject = par_dark.low_rej[is];
01314 
01315    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.dark.high_rejection");
01316    cfg -> hi_reject = par_dark.hig_rej[is];
01317   
01318 }
01319 
01320 
01321 
01322 
01323 
01324 void
01325 rec_distortion_set(finddist_config* cfg, cpl_parameterlist *   cpl_cfg, int is)
01326 {
01327 
01328 
01329   cpl_parameter* p;
01330    strcpy(cfg -> outName, DISTORTION_OUT_FILENAME);
01331 
01332 
01333 
01334    cfg -> guessBeginWavelength = par_distortion.guess_wstart[is];
01335    cfg -> guessDispersion1 =  par_distortion.guess_wdisp1[is];
01336    cfg -> guessDispersion2 =  par_distortion.guess_wdisp2[is];
01337 
01338    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.distortion.min_diff_mean_med_col_int");
01339    cfg -> mindiff =  par_distortion.min_diff_mean_med_col_int[is];
01340 
01341    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.distortion.half_width");
01342    cfg -> halfWidth = par_distortion.half_width[is];
01343 
01344    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.distortion.sigma");
01345    cfg -> sigma =  par_distortion.sigma[is];
01346 
01347    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.distortion.fwhm");
01348    cfg -> fwhm =  par_distortion.fwhm[is];
01349 
01350    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.distortion.min_amplitude");
01351    cfg -> minAmplitude =  par_distortion.min_amp[is];
01352 
01353    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.distortion.max_residual");
01354    cfg -> maxResidual =  par_distortion.max_res[is];
01355 
01356    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.distortion.n_a_coefficients");
01357    cfg -> nrDispCoefficients = par_distortion.n_disp_coef[is];
01358 
01359    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.distortion.n_b_coefficients");
01360    cfg -> nrCoefCoefficients = par_distortion.n_coef_coef[is];
01361 
01362    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.distortion.sigma_factor");
01363    cfg -> sigmaFactor =  par_distortion.sigma_fct[is];
01364 
01365    cfg -> nslitlets =  NSLITLETS;
01366 
01367    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.distortion.pixel_dist");
01368    cfg -> pixeldist = par_distortion.pixel_dist[is];
01369 
01370    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.distortion.pixel_tol");
01371    cfg -> pixel_tolerance = par_distortion.pixel_tol[is];
01372 
01373    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.distortion.mag_factor");
01374    cfg -> magFactor = par_distortion.mag_factor;
01375 
01376 
01377    cfg -> loPos =  par_distortion.low_pos;
01378    cfg -> hiPos =  par_distortion.hig_pos;
01379 
01380    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.distortion.box_length");
01381    cfg -> boxLength =  par_distortion.box_length[is];
01382 
01383    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.distortion.y_box");
01384    cfg -> yBox = par_distortion.y_box[is];
01385 
01386    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.distortion.diff_tol");
01387    cfg -> diffTol =  par_distortion.diff_tol[is];
01388 
01389 
01390    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.distortion.diff_tol");
01391    strcpy(cfg -> outName,  DISTORTION_NS_OUT_FILENAME);
01392 
01393    cfg -> nslits = NSLITLETS;
01394 
01395    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.distortion.ns_half_width");
01396    cfg -> nshalfWidth = par_distortion.ns_half_width[is];
01397 
01398    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.distortion.ns_fwhm");
01399    cfg -> nsfwhm = par_distortion.nsfwhm[is];
01400 
01401    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.distortion.min_diff");
01402    cfg -> minDiff = par_distortion.min_Diff[is];
01403 
01404    cfg -> estimated_dist = ESTIMATED_SLITLETS_DISTANCE;
01405 
01406    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.distortion.dev_tol");
01407    cfg -> devtol = par_distortion.dev_tol[is];
01408 
01409 
01410 
01411 }
01412 
01413 
01414 void rec_nst_set(ns_config* cfg, cpl_parameterlist* cpl_cfg, int is)
01415 {
01416    cpl_parameter *p=NULL; 
01417 
01418 
01419 
01420  
01421 
01422  p = cpl_parameterlist_find(cpl_cfg, "sinfoni.north_south_test.low_rejection");
01423    cfg -> loReject = par_nst.low_rej[is];
01424 
01425    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.north_south_test.high_rejection");
01426    cfg -> hiReject = par_nst.hig_rej[is];
01427 
01428    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.north_south_test.mask_ind");
01429    cfg -> maskInd =  par_nst.mask_ind;
01430 
01431    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.north_south_test.gauss_ind");
01432    cfg -> gaussInd = par_nst.gauss_ind;
01433 
01434    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.north_south_test.kernel_half_width");
01435    cfg -> hw = par_nst.hw[is];
01436 
01437    strcat(cfg -> fitsname, NS_TEST_OUT_FILENAME);
01438 
01439    cfg -> nslits = NSLITLETS;
01440   
01441    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.north_south_test.half_width");
01442    cfg -> halfWidth = par_nst.half_width[is];
01443 
01444    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.north_south_test.fwhm");
01445    cfg -> fwhm = par_nst.fwhm[is];
01446 
01447    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.north_south_test.min_diff");
01448    cfg -> minDiff = par_nst.min_diff[is];
01449 
01450    cfg -> estimated_dist = ESTIMATED_SLITLETS_DISTANCE;
01451 
01452    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.north_south_test.dev_tol");
01453    cfg -> devtol = par_nst.dev_tol[is];
01454 
01455 
01456 }
01457 
01458 
01459 void
01460 rec_stack_sci_set(stack_config_n* cfg, cpl_parameterlist *   cpl_cfg, int is)
01461 {
01462 
01463 
01464    cpl_parameter* p=NULL;
01465    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.low_rejection");
01466    cfg -> loReject = par_stack_sci.low_rej[is];
01467 
01468    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.high_rejection");
01469    cfg -> hiReject = par_stack_sci.hig_rej[is];
01470 
01471    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.flat_index");
01472    cfg -> flatInd = par_stack_sci.flat_ind;
01473             
01474    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.ind_index");
01475    cfg -> indind = par_stack_sci.ind_ind ; 
01476 
01477    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.mask_index");
01478    cfg -> maskInd = par_stack_sci.mask_ind ;
01479 
01480    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.mask_rad");
01481    cfg -> maxRad = par_stack_sci.max_rad[is];
01482 
01483    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.sigma_factor");
01484    cfg -> sigmaFactor = par_stack_sci.sig_fct[is];
01485 
01486    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.inter_index");
01487    cfg -> interInd = par_stack_sci.int_ind;
01488 
01489    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.no_rows");
01490    cfg -> noRows = par_stack_sci.nrow[is];
01491 
01492    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.gauss_index");
01493    cfg -> gaussInd = par_stack_sci.gauss_ind;
01494 
01495    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.kernel_half_width");
01496    cfg -> hw = par_stack_sci.half_width[is] ;
01497 
01498    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.shift_frame_index");
01499    cfg -> sfInd  =  par_stack_sci.shift_frm_ind;
01500 
01501    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.shift_frame_type");
01502    cfg -> sfType = par_stack_sci.shift_frm_type;
01503 
01504    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.shift_frame_order");
01505    cfg -> sfOrder = par_stack_sci.shift_frm_ord;
01506 
01507    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.stacked.warpfix_ind");
01508    cfg -> warpfixInd =  par_stack_sci.warp_fix_ind;
01509 
01510    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.stacked.warpfix_kernel");
01511    strcpy(cfg -> kernel,  par_stack_sci.warp_fix_kernel);
01512 
01513 
01514 }
01515 
01516 void
01517 rec_stack_find_distortion_set(stack_config_n* cfg, cpl_parameterlist *   cpl_cfg, int is)
01518 {
01519 
01520 
01521    cpl_parameter* p=NULL;
01522    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.low_rejection");
01523    cfg -> loReject = par_stack_find_distortion.low_rej[is];
01524 
01525    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.high_rejection");
01526    cfg -> hiReject = par_stack_find_distortion.hig_rej[is];
01527 
01528    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.flat_index");
01529    cfg -> flatInd = par_stack_find_distortion.flat_ind;
01530             
01531    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.ind_index");
01532    cfg -> indind = par_stack_find_distortion.ind_ind ; 
01533 
01534    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.mask_index");
01535    cfg -> maskInd = par_stack_find_distortion.mask_ind ;
01536 
01537    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.mask_rad");
01538    cfg -> maxRad = par_stack_find_distortion.max_rad[is];
01539 
01540    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.sigma_factor");
01541    cfg -> sigmaFactor = par_stack_find_distortion.sig_fct[is];
01542 
01543    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.inter_index");
01544    cfg -> interInd = par_stack_find_distortion.int_ind;
01545 
01546    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.no_rows");
01547    cfg -> noRows = par_stack_find_distortion.nrow[is];
01548 
01549    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.gauss_index");
01550    cfg -> gaussInd = par_stack_find_distortion.gauss_ind;
01551 
01552    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.kernel_half_width");
01553    cfg -> hw = par_stack_find_distortion.half_width[is] ;
01554 
01555    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.shift_frame_index");
01556    cfg -> sfInd  =  par_stack_find_distortion.shift_frm_ind;
01557 
01558    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.shift_frame_type");
01559    cfg -> sfType = par_stack_find_distortion.shift_frm_type;
01560 
01561    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.shift_frame_order");
01562    cfg -> sfOrder = par_stack_find_distortion.shift_frm_ord;
01563 
01564    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.stacked.warpfix_ind");
01565    cfg -> warpfixInd =  par_stack_find_distortion.warp_fix_ind;
01566 
01567    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.stacked.warpfix_kernel");
01568    strcpy(cfg -> kernel,  par_stack_find_distortion.warp_fix_kernel);
01569 
01570 
01571 }
01572 
01573 
01574 void
01575 rec_stack_psf_set(stack_config_n* cfg, cpl_parameterlist *   cpl_cfg, int is)
01576 {
01577 
01578 
01579    cpl_parameter* p=NULL;
01580    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.low_rejection");
01581    cfg -> loReject = par_stack_psf.low_rej[is];
01582 
01583    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.high_rejection");
01584    cfg -> hiReject = par_stack_psf.hig_rej[is];
01585 
01586    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.flat_index");
01587    cfg -> flatInd = par_stack_psf.flat_ind;
01588             
01589    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.ind_index");
01590    cfg -> indind = par_stack_psf.ind_ind ; 
01591 
01592    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.mask_index");
01593    cfg -> maskInd = par_stack_psf.mask_ind ;
01594 
01595    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.mask_rad");
01596    cfg -> maxRad = par_stack_psf.max_rad[is];
01597 
01598    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.sigma_factor");
01599    cfg -> sigmaFactor = par_stack_psf.sig_fct[is];
01600 
01601    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.inter_index");
01602    cfg -> interInd = par_stack_psf.int_ind;
01603 
01604    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.no_rows");
01605    cfg -> noRows = par_stack_psf.nrow[is];
01606 
01607    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.gauss_index");
01608    cfg -> gaussInd = par_stack_psf.gauss_ind;
01609 
01610    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.kernel_half_width");
01611    cfg -> hw = par_stack_psf.half_width[is] ;
01612 
01613    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.shift_frame_index");
01614    cfg -> sfInd  =  par_stack_psf.shift_frm_ind;
01615 
01616    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.shift_frame_type");
01617    cfg -> sfType = par_stack_psf.shift_frm_type;
01618 
01619    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.shift_frame_order");
01620    cfg -> sfOrder = par_stack_psf.shift_frm_ord;
01621 
01622    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.stacked.warpfix_ind");
01623    cfg -> warpfixInd =  par_stack_psf.warp_fix_ind;
01624 
01625    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.stacked.warpfix_kernel");
01626    strcpy(cfg -> kernel,  par_stack_psf.warp_fix_kernel);
01627 
01628 
01629 }
01630 
01631 void
01632 rec_stack_focus_set(stack_config_n* cfg, cpl_parameterlist *   cpl_cfg, int is)
01633 {
01634 
01635 
01636    cpl_parameter* p=NULL;
01637    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.low_rejection");
01638    cfg -> loReject = par_stack_focus.low_rej[is];
01639 
01640    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.high_rejection");
01641    cfg -> hiReject = par_stack_focus.hig_rej[is];
01642 
01643    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.flat_index");
01644    cfg -> flatInd = par_stack_focus.flat_ind;
01645             
01646    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.ind_index");
01647    cfg -> indind = par_stack_focus.ind_ind ; 
01648 
01649    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.mask_index");
01650    cfg -> maskInd = par_stack_focus.mask_ind ;
01651 
01652    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.mask_rad");
01653    cfg -> maxRad = par_stack_focus.max_rad[is];
01654 
01655    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.sigma_factor");
01656    cfg -> sigmaFactor = par_stack_focus.sig_fct[is];
01657 
01658    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.inter_index");
01659    cfg -> interInd = par_stack_focus.int_ind;
01660 
01661    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.no_rows");
01662    cfg -> noRows = par_stack_focus.nrow[is];
01663 
01664    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.gauss_index");
01665    cfg -> gaussInd = par_stack_focus.gauss_ind;
01666 
01667    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.kernel_half_width");
01668    cfg -> hw = par_stack_focus.half_width[is] ;
01669 
01670    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.shift_frame_index");
01671    cfg -> sfInd  =  par_stack_focus.shift_frm_ind;
01672 
01673    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.shift_frame_type");
01674    cfg -> sfType = par_stack_focus.shift_frm_type;
01675 
01676    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.shift_frame_order");
01677    cfg -> sfOrder = par_stack_focus.shift_frm_ord;
01678 
01679    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.stacked.warpfix_ind");
01680    cfg -> warpfixInd =  par_stack_focus.warp_fix_ind;
01681 
01682    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.stacked.warpfix_kernel");
01683    strcpy(cfg -> kernel,  par_stack_focus.warp_fix_kernel);
01684 
01685 
01686 }
01687 
01688 
01689 
01690 void
01691 rec_stack_lampspec_set(stack_config_n* cfg, cpl_parameterlist *   cpl_cfg, int is)
01692 {
01693 
01694 
01695    cpl_parameter* p=NULL;
01696    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.low_rejection");
01697    cfg -> loReject = par_stack_lampspec.low_rej[is];
01698 
01699    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.high_rejection");
01700    cfg -> hiReject = par_stack_lampspec.hig_rej[is];
01701 
01702    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.flat_index");
01703    cfg -> flatInd = par_stack_lampspec.flat_ind;
01704             
01705    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.ind_index");
01706    cfg -> indind = par_stack_lampspec.ind_ind ; 
01707 
01708    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.mask_index");
01709    cfg -> maskInd = par_stack_lampspec.mask_ind ;
01710 
01711    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.mask_rad");
01712    cfg -> maxRad = par_stack_lampspec.max_rad[is];
01713 
01714    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.sigma_factor");
01715    cfg -> sigmaFactor = par_stack_lampspec.sig_fct[is];
01716 
01717    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.inter_index");
01718    cfg -> interInd = par_stack_lampspec.int_ind;
01719 
01720    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.no_rows");
01721    cfg -> noRows = par_stack_lampspec.nrow[is];
01722 
01723    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.gauss_index");
01724    cfg -> gaussInd = par_stack_lampspec.gauss_ind;
01725 
01726    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.kernel_half_width");
01727    cfg -> hw = par_stack_lampspec.half_width[is] ;
01728 
01729    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.shift_frame_index");
01730    cfg -> sfInd  =  par_stack_lampspec.shift_frm_ind;
01731 
01732    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.shift_frame_type");
01733    cfg -> sfType = par_stack_lampspec.shift_frm_type;
01734 
01735    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.shift_frame_order");
01736    cfg -> sfOrder = par_stack_lampspec.shift_frm_ord;
01737 
01738    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.stacked.warpfix_ind");
01739    cfg -> warpfixInd =  par_stack_lampspec.warp_fix_ind;
01740 
01741    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.stacked.warpfix_kernel");
01742    strcpy(cfg -> kernel,  par_stack_lampspec.warp_fix_kernel);
01743 
01744 
01745 }
01746 
01747 
01748 
01749 
01750 void
01751 rec_stack_wcal_set(stack_config_n* cfg, cpl_parameterlist *   cpl_cfg, int is)
01752 {
01753 
01754    cpl_parameter* p=NULL;
01755    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.low_rejection");
01756    cfg -> loReject = par_stack_wcal.low_rej[is];
01757 
01758    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.high_rejection");
01759    cfg -> hiReject = par_stack_wcal.hig_rej[is];
01760 
01761    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.flat_index");
01762    cfg -> flatInd = par_stack_wcal.flat_ind;
01763             
01764    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.ind_index");
01765    cfg -> indind = par_stack_wcal.ind_ind ; 
01766 
01767    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.mask_index");
01768    cfg -> maskInd = par_stack_wcal.mask_ind ;
01769 
01770    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.mask_rad");
01771    cfg -> maxRad = par_stack_wcal.max_rad[is];
01772 
01773    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.sigma_factor");
01774    cfg -> sigmaFactor = par_stack_wcal.sig_fct[is];
01775 
01776    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.inter_index");
01777    cfg -> interInd = par_stack_wcal.int_ind;
01778 
01779    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.no_rows");
01780    cfg -> noRows = par_stack_wcal.nrow[is];
01781 
01782    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.gauss_index");
01783    cfg -> gaussInd = par_stack_wcal.gauss_ind;
01784 
01785    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.kernel_half_width");
01786    cfg -> hw = par_stack_wcal.half_width[is] ;
01787 
01788    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.shift_frame_index");
01789    cfg -> sfInd  =  par_stack_wcal.shift_frm_ind;
01790 
01791    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.shift_frame_type");
01792    cfg -> sfType = par_stack_wcal.shift_frm_type;
01793 
01794    p = cpl_parameterlist_find(cpl_cfg,"sinfoni.stacked.shift_frame_order");
01795    cfg -> sfOrder = par_stack_wcal.shift_frm_ord;
01796 
01797    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.stacked.warpfix_ind");
01798    cfg -> warpfixInd =  par_stack_wcal.warp_fix_ind;
01799 
01800    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.stacked.warpfix_kernel");
01801    strcpy(cfg -> kernel,  par_stack_wcal.warp_fix_kernel);
01802 
01803 }
01804 void
01805 rec_lampflats_set(flat_config* cfg, cpl_parameterlist *   cpl_cfg, int is)
01806 {
01807 
01808 
01809 
01810 
01811   cpl_parameter* p;
01812 
01813 
01814    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.lamp_flats.low_rejection");
01815    cfg -> loReject = par_lampflat.low_rej[is];
01816 
01817    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.lamp_flats.high_rejection");
01818    cfg -> hiReject =  par_lampflat.hig_rej[is];
01819 
01820    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.lamp_flats.interpol_index");
01821    cfg -> interpolInd =  par_lampflat.interpol_ind;
01822 
01823    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.lamp_flats.max_rad");
01824    cfg -> maxRad =  par_lampflat.max_rad[is];
01825 
01826    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.lamp_flats.bad_ind");
01827    cfg ->  badInd = par_lampflat.bad_ind;
01828 
01829    strcpy(cfg -> maskname, LAMP_FLATS_OUT_BPMAP);
01830 
01831    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.lamp_flats.sigma_factor");
01832    cfg -> sigmaFactor = par_lampflat.sigma_factor[is];
01833 
01834    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.lamp_flats.factor");
01835    cfg -> factor = par_lampflat.factor[is];
01836 
01837    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.lamp_flats.iterations");
01838    cfg -> iterations = par_lampflat.iterations;
01839 
01840    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.lamp_flats.bad_low_rejection");
01841    cfg -> badLoReject = par_lampflat.bad_low_rej[is];
01842 
01843    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.lamp_flats.bad_high_rejection");
01844    cfg -> badHiReject = par_lampflat.bad_hig_rej[is];
01845 
01846    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.lamp_flats.llx");
01847    cfg -> llx = par_lampflat.llx[is];
01848 
01849    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.lamp_flats.lly");
01850    cfg -> lly = par_lampflat.lly[is];
01851 
01852    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.lamp_flats.urx");
01853    cfg -> urx = par_lampflat.urx[is];
01854 
01855    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.lamp_flats.ury");
01856    cfg -> ury = par_lampflat.ury[is];
01857 
01858    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.lamp_flats.thresh_ind");
01859    cfg -> threshInd = par_lampflat.thresh_ind;
01860 
01861    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.lamp_flats.mean_factor");
01862    cfg -> meanfactor = par_lampflat.mean_factor[is];
01863 
01864 
01865 }
01866 
01867 
01868 void
01869 rec_wcal_set(wave_config* cfg, cpl_parameterlist *   cpl_cfg, int is)
01870 {
01871 
01872 
01873 
01874 
01875   cpl_parameter* p;
01876    strcpy(cfg -> outName, WAVECAL_OUT_FILENAME);
01877    strcpy(cfg -> slitposName, WAVECAL_SLIT_POS_OUT_FILENAME);
01878    strcpy(cfg -> paramsList, WAVECAL_FIT_PARAMS_OUT_FILENAME);
01879 
01880    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.wavecal.calib_indicator");
01881    cfg -> calibIndicator = par_wcal.calib_ind;
01882 
01883    cfg -> guessBeginWavelength = par_wcal.guess_wstart[is];
01884    cfg -> guessDispersion1 =  par_wcal.guess_wdisp1[is];
01885    cfg -> guessDispersion2 =  par_wcal.guess_wdisp2[is];
01886 
01887    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.wavecal.min_diff");
01888    cfg -> mindiff =  par_wcal.min_diff[is];
01889 
01890    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.wavecal.half_width");
01891    cfg -> halfWidth = par_wcal.half_width[is];
01892 
01893    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.wavecal.sigma");
01894    cfg -> sigma =  par_wcal.sigma[is];
01895 
01896    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.wavecal.fwhm");
01897    cfg -> fwhm =  par_wcal.fwhm[is];
01898 
01899    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.wavecal.min_amplitude");
01900    cfg -> minAmplitude =  par_wcal.min_amp[is];
01901 
01902    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.wavecal.max_residual");
01903    cfg -> maxResidual =  par_wcal.max_res[is];
01904 
01905    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.wavecal.n_a_coefficients");
01906    cfg -> nrDispCoefficients = par_wcal.n_disp_coef[is];
01907 
01908    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.wavecal.n_b_coefficients");
01909    cfg -> nrCoefCoefficients = par_wcal.n_coef_coef[is];
01910 
01911    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.wavecal.sigma_factor");
01912    cfg -> sigmaFactor =  par_wcal.sigma_fct[is];
01913 
01914    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.wavecal.write_coeffs_ind");
01915    cfg -> writeCoeffsInd = par_wcal.write_coef_ind;
01916 
01917    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.wavecal.write_par_ind");
01918    cfg -> writeParInd = par_wcal.write_par_ind;
01919 
01920    cfg -> nslitlets =  NSLITLETS;
01921 
01922    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.wavecal.pixel_dist");
01923    cfg -> pixeldist = par_wcal.pixel_dist[is];
01924 
01925    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.wavecal.pixel_tol");
01926    cfg -> pixel_tolerance = par_wcal.pixel_tol[is];
01927 
01928    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.wavecal.wave_map_ind");
01929    cfg -> wavemapInd = par_wcal.wave_map_ind;
01930 
01931    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.wavecal.mag_factor");
01932    cfg -> magFactor = par_wcal.mag_factor;
01933 
01934    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.wavecal.slit_pos_indicator");
01935    cfg -> slitposIndicator = par_wcal.slitpos_ind;
01936 
01937    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.wavecal.fit_boltz_indicator");
01938    cfg -> fitBoltzIndicator = par_wcal.fit_boltz_ind;
01939 
01940    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.wavecal.fit_edge_indicator");
01941    cfg -> fitEdgeIndicator = par_wcal.fit_edge_ind;
01942 
01943    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.wavecal.estimate_indicator");
01944    cfg -> estimateIndicator = par_wcal.estimate_ind;
01945 
01946    cfg -> loPos =  par_wcal.low_pos[is];
01947    cfg -> hiPos =  par_wcal.hig_pos[is];
01948 
01949    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.wavecal.box_length");
01950    cfg -> boxLength =  par_wcal.box_length[is];
01951 
01952    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.wavecal.y_box");
01953    cfg -> yBox = par_wcal.y_box[is];
01954 
01955    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.wavecal.diff_tol");
01956    cfg -> diffTol =  par_wcal.diff_tol[is];
01957 
01958 }
01959 
01960 void
01961 rec_cubecreate_set(cube_config* cfg, cpl_parameterlist * cpl_cfg, int is)
01962 {
01963 
01964    cpl_parameter* p;
01965    char s[1];
01966    strcpy(cfg -> outName, QCFLAT_OUT_FILENAME);
01967 
01968    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.cubecreate.n_coeffs");
01969    cfg -> ncoeffs = par_cubecreate.n_coeffs[is];
01970    /*
01971    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.cubecreate.halo_correct_index");
01972    */
01973    cfg -> halocorrectInd = par_cubecreate.halo_correct_ind;
01974 
01975    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.cubecreate.nord_south_index");
01976    cfg -> northsouthInd = par_cubecreate.north_south_ind;
01977 
01978    cfg -> nslits = NSLITLETS;
01979 
01980    /* s = (char*) calloc(1,sizeof(char ));a */
01981    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.cubecreate.fine_tuning_method");
01982    strcpy(s, par_cubecreate.method);
01983    cfg -> method = s[0];
01984 
01985    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.cubecreate.order");
01986    cfg -> order = par_cubecreate.order[is];
01987    /* free(s); */
01988 
01989 }
01990 
01991 void
01992 rec_lampspec_set(lamp_config* cfg, cpl_parameterlist *   cpl_cfg, int is)
01993 {
01994 
01995    cpl_parameter *p; 
01996    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.lamp_spec.ncoeffs");
01997    cfg -> ncoeffs =  par_lampspec.ncoeffs[is];
01998 
01999    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.lamp_spec.output_filename");
02000    strcpy(cfg -> outName, par_lampspec.out_name);
02001 
02002    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.lamp_spec.lower_rejection");
02003    cfg -> loReject = par_lampspec.low_rej[is];
02004 
02005    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.lamp_spec.higher_rejection");
02006    cfg -> hiReject = par_lampspec.hig_rej[is];
02007 
02008    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.lamp_spec.counts_to_intensity");
02009    cfg -> countsToIntensity = par_lampspec.counts_to_intensity[is];
02010 
02011  
02012 }
02013 void
02014 rec_twiflat_set(twiflat_config* cfg, cpl_parameterlist *   cpl_cfg, int is)
02015 {
02016 
02017  
02018    cpl_parameter *p; 
02019    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.twiflat.output_filename");
02020    strcpy(cfg -> outName,TWIFLAT_OUT_FILENAME );
02021 
02022    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.twiflat.lower_rejection");
02023    cfg -> loReject = par_twiflat.low_rej[is];
02024 
02025    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.twiflat.higher_rejection");
02026    cfg -> hiReject = par_twiflat.hig_rej[is];
02027 
02028    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.twiflat.warpfix_ind");
02029    cfg -> warpfixInd = par_twiflat.warp_fix_ind ;
02030 
02031    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.twiflat.warpfix_kernel");
02032    strcpy(cfg -> kernel, par_twiflat.kernel);
02033 
02034  
02035 }
02036 
02037 void
02038 rec_psf_set(psf_config* cfg, cpl_parameterlist *   cpl_cfg, int is)
02039 {
02040 
02041 
02042 
02043    strcpy(cfg -> outName, PSF_OUT_FILENAME);
02044 
02045    cfg -> nslits = NSLITLETS;
02046  
02047 
02048 }
02049 
02050 
02051 void
02052 rec_focus_set(focus_config* cfg, cpl_parameterlist *   cpl_cfg, int is)
02053 {
02054 
02055 
02056   cpl_parameter* p=NULL;
02057   p = cpl_parameterlist_find(cpl_cfg, "sinfoni.focus.output_filename");
02058    strcpy(cfg -> outName, par_focus.out_name);
02059 
02060    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.focus.lower_rejection");
02061    cfg -> lo_reject = par_focus.low_rej[is];
02062 
02063    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.focus.higher_rejection");
02064    cfg -> hi_reject = par_focus.hig_rej[is];
02065 
02066    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.focus.north_south_index");
02067    cfg -> northsouthInd =  par_focus.north_south_ind;
02068 
02069    cfg -> nslits = NSLITLETS;
02070  
02071    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.focus.method");
02072    strcpy(cfg->method, par_focus.method);
02073 
02074    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.focus.order");
02075    cfg -> order= par_focus.order[is];
02076 
02077    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.focus.llx");
02078    cfg -> llx = par_focus.llx[is];
02079 
02080    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.focus.lly");
02081    cfg -> lly = par_focus.lly[is];
02082 
02083    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.focus.halfbox_x");
02084    cfg -> halfbox_x = par_focus.halfbox_x[is];
02085 
02086    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.focus.halfbox_y");
02087    cfg -> halfbox_y = par_focus.halfbox_y[is];
02088 
02089    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.focus.mpar0");
02090    cfg -> mpar0 = par_focus.mpar0[is];
02091 
02092    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.focus.mpar1");
02093    cfg -> mpar1 = par_focus.mpar1[is];
02094 
02095    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.focus.mpar2");
02096    cfg -> mpar2 = par_focus.mpar2[is];
02097 
02098    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.focus.mpar3");
02099    cfg -> mpar3 = par_focus.mpar3[is];
02100 
02101    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.focus.mpar4");
02102    cfg -> mpar4 = par_focus.mpar4[is];
02103 
02104    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.focus.mpar5");
02105    cfg -> mpar5 = par_focus.mpar5[is];
02106 
02107    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.focus.mpar6");
02108    cfg -> mpar6 = par_focus.mpar6[is];
02109 
02110    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.focus.fit_list");
02111    strcpy(cfg -> fitlist,par_focus.fit_list);
02112 
02113    /* int or string ?*/
02114    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.focus.plot_gauss_ind");
02115    cfg -> plotGaussInd = par_focus.plot_gauss_ind;
02116 
02117    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.focus.gauss_plot_name");
02118    strcpy( cfg -> gaussplotName, par_focus.gauss_plot_name);
02119 
02120 }
02121 
02122 void
02123 rec_objnod_set(object_config* cfg, cpl_parameterlist *   cpl_cfg, int is)
02124 {
02125 
02126    cpl_parameter* p;
02127    strcpy(cfg -> outName, OBJNOD_OUT_FILENAME);
02128    strcpy(cfg -> maskname, OBJNOD_OUT_BPMAP);
02129 
02130    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.objnod.jitter_index");
02131    cfg -> jitterind = par_objnod.jitter_ind;
02132 
02133    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.objnod.size_x");
02134    cfg -> size_x = par_objnod.size_x[is];
02135 
02136    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.objnod.size_y");
02137    cfg -> size_y = par_objnod.size_y[is];
02138 
02139    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.objnod.kernel_type");
02140    strcpy(cfg -> kernel_type, par_objnod.kernel_type);
02141 
02142    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.objnod.n_coeffs");
02143    cfg -> ncoeffs = par_objnod.n_coeffs[is];
02144 
02145    /*
02146    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.objnod.halo_correct_index");
02147    */
02148    cfg -> halocorrectInd = par_objnod.halo_correct_ind;
02149 
02150    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.objnod.nord_south_index");
02151    cfg -> northsouthInd = par_objnod.north_south_ind;
02152 
02153    cfg -> nslits = NSLITLETS;
02154 
02155    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.objnod.fine_tuning_method");
02156    strcpy(cfg -> method, par_objnod.method);
02157 
02158    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.objnod.order");
02159    cfg -> order = par_objnod.order;
02160 
02161    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.objnod.low_rejection");
02162    cfg -> loReject = par_objnod.low_rej[is];
02163 
02164    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.objnod.high_rejection");
02165    cfg -> hiReject = par_objnod.hig_rej[is];
02166 
02167    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.objnod.tolerance");
02168    cfg -> tolerance = par_objnod.tol[is];
02169 
02170 }
02171 
02172 void
02173 rec_objspider_set(object_config* cfg, cpl_parameterlist *   cpl_cfg, int is)
02174 {
02175 
02176   cpl_parameter* p;
02177    strcpy(cfg -> outName, SKYSPIDER_OUT_FILENAME);
02178    strcpy(cfg -> maskname, SKYSPIDER_MASK_OUT_FILENAME);
02179 
02180    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.objspider.jitter_index");
02181    cfg -> jitterind = par_objspider.jitter_ind;
02182 
02183    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.objspider.size_x");
02184    cfg -> size_x = par_objspider.size_x[is];
02185 
02186    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.objspider.size_y");
02187    cfg -> size_y = par_objspider.size_y[is];
02188 
02189    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.objspider.kernel_type");
02190    strcpy(cfg -> kernel_type, par_objspider.kernel_type);
02191 
02192    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.objspider.n_coeffs");
02193    cfg -> ncoeffs = par_objspider.n_coeffs[is];
02194 
02195    /*
02196    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.objspider.halo_correct_index");
02197    */
02198    cfg -> halocorrectInd = par_objspider.halo_correct_ind;
02199 
02200    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.objspider.nord_south_index");
02201    cfg -> northsouthInd = par_objspider.north_south_ind;
02202 
02203    cfg -> nslits = NSLITLETS;
02204 
02205    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.objspider.fine_tuning_method");
02206    strcpy(cfg -> method, par_objspider.method);
02207 
02208    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.objspider.order");
02209    cfg -> order = par_objspider.order;
02210 
02211    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.objspider.lower_rejection");
02212    cfg -> loReject = par_objspider.low_rej[is];
02213 
02214    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.objspider.higher_rejection");
02215    cfg -> hiReject = par_objspider.hig_rej[is];
02216 
02217    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.objspider.tolerance");
02218    cfg -> tolerance = par_objspider.tol[is];
02219 
02220 }
02221 
02222 void
02223 rec_stdstar_set(standstar_config* cfg, cpl_parameterlist *   cpl_cfg, int is)
02224 {
02225 
02226    cpl_parameter* p;
02227    strcpy(cfg -> outName, STDSTAR_OUT_FILENAME);
02228 
02229    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.std_star.low_rejection");
02230    cfg -> lo_reject = par_stdstar.low_rej[is];
02231 
02232    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.std_star.high_rejection");
02233    cfg -> hi_reject = par_stdstar.hig_rej[is];
02234 
02235    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.std_star.llx");
02236    cfg -> llx = par_stdstar.llx[is];
02237 
02238    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.std_star.lly");
02239    cfg -> lly = par_stdstar.lly[is];
02240 
02241    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.std_star.half_box_x");
02242    cfg -> halfbox_x = par_stdstar.halfbox_x[is];
02243 
02244    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.std_star.half_box_y");
02245    cfg -> halfbox_y = par_stdstar.halfbox_y[is];
02246 
02247    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.std_star.fwhm_factor");
02248    cfg -> fwhm_factor = par_stdstar.fwhm_factor[is];
02249 
02250    cfg -> backvariance = par_stdstar.back_variance;
02251    cfg -> sky =  par_stdstar.sky;
02252    cfg -> gain =  par_stdstar.gain;
02253 
02254    p = cpl_parameterlist_find(cpl_cfg, "sinfoni.std_star.conversion_index");
02255    cfg -> convInd = par_stdstar.conv_ind;
02256  
02257    strcpy(cfg -> convName, STDSTAR_CONV_OUT_FILENAME);
02258    cfg -> mag = par_stdstar.mag;
02259 
02260 
02261 }

Generated on Wed Oct 26 13:08:55 2005 for SINFONI Pipeline Reference Manual by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001