sinfoni_distortion_config.c

00001 /* $Id: sinfoni_distortion_config.c,v 1.8 2005/07/28 17:12:17 amodigli Exp $
00002  *
00003  * This file is part of the CPL (Common Pipeline Library)
00004  * Copyright (C) 2002 European Southern Observatory
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * This library 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 GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  */
00020 /*
00021  * $Author: amodigli $
00022  * $Date: 2005/07/28 17:12:17 $
00023  * $Revision: 1.8 $
00024  * $Name:  $
00025  */
00026 
00027  /****************************************************************
00028   *   Wavecal Frames Data Reduction Parameter Initialization        *
00029   ****************************************************************/
00030 
00031 #include "sinfoni_distortion_config.h"
00032 #include "sinfoni_globals.h"
00033  void
00034  sinfoni_distortion_config_add(cpl_parameterlist *list)
00035 {
00036 
00037   cpl_parameter *p;
00038 
00039   if (!list) {
00040     return;
00041   }
00042 
00043   /* Output file name */
00044 /* output name of resulting fits wavelength map */
00045 
00046 
00047 /* Find Lines */
00048 /* indicates if the dispersion relation is already determined or not */
00049   p = cpl_parameter_new_value("sinfoni.distortion.calib_indicator",
00050                   CPL_TYPE_BOOL,
00051                               "Calib Indicator: "
00052                               "FALSE: if the dispersion relation is already "
00053                               "known, the routine can jump to the waveMap "
00054                               "section "
00055                               "TRUE: if the dispersion relation "
00056                               "must first be determined",
00057                               "sinfoni.distortion",
00058                               TRUE);
00059 
00060   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-calib_indicator");
00061   cpl_parameterlist_append(list, p);
00062 
00063 
00064 /* minimal difference of mean and median column intensity */
00065   p = cpl_parameter_new_value("sinfoni.distortion.min_diff_mean_med_col_int",
00066                   CPL_TYPE_DOUBLE,
00067                               "Minimum Of Difference: "
00068                               "minimum difference of mean and median column "
00069                               "intensity to carry out the cross correlation",
00070                               "sinfoni.distortion",
00071                               10.);
00072 
00073   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-min_diff_mean_med_col_int");
00074   cpl_parameterlist_append(list, p);
00075 
00076 /* half width of a box within which the line must sit */
00077   p = cpl_parameter_new_value("sinfoni.distortion.half_width",
00078                   CPL_TYPE_INT,
00079                               "Half Width: "
00080                               "half width of a box within which the line "
00081                               "must be placed",
00082                               "sinfoni.distortion",
00083                               7);
00084 
00085   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-hw");
00086   cpl_parameterlist_append(list, p);
00087 
00088 /* sigma of Gaussian of artificial model spectra */
00089   p = cpl_parameter_new_value("sinfoni.distortion.sigma",
00090                   CPL_TYPE_DOUBLE,
00091                               "Sigma: sigma of Gaussian which is convolved "
00092                               "with the artificial spectrum generated using "
00093                               "the line list",
00094                               "sinfoni.distortion",
00095                                2.);
00096 
00097   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-sigma");
00098   cpl_parameterlist_append(list, p);
00099 
00100   /* Wavelength Calibration */
00101 /* guess value for fwhm of emission lines */
00102   p = cpl_parameter_new_value("sinfoni.distortion.fwhm",
00103                   CPL_TYPE_DOUBLE,
00104                               "FWHM: initial guess value for the fwhm of "
00105                               "the Gaussian used for the line fit",
00106                               "sinfoni.distortion",
00107                                2.83);
00108 
00109   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-fwhm");
00110   cpl_parameterlist_append(list, p);
00111 
00112 /* minimum amplitude of a line to be fitted */
00113   p = cpl_parameter_new_value("sinfoni.distortion.min_amplitude",
00114                   CPL_TYPE_DOUBLE,
00115                               "Minimum Of Amplitude: "
00116                               "of the Gaussian to do the fit",
00117                               "sinfoni.distortion",
00118                               5.);
00119 
00120   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-min_amplitude");
00121   cpl_parameterlist_append(list, p);
00122 
00123 /* maximal residual value for a valid fit */
00124   p = cpl_parameter_new_value("sinfoni.distortion.max_residual",
00125                   CPL_TYPE_DOUBLE,
00126                               "Maximum Residuals value: "
00127                               "beyond this value the fit is rejected",
00128                               "sinfoni.distortion",
00129                               0.5);
00130 
00131   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-max_residual");
00132   cpl_parameterlist_append(list, p);
00133 
00134 /* # of polynomial coefficients used for the dispersion relation */
00135   p = cpl_parameter_new_value("sinfoni.distortion.n_a_coefficients",
00136                   CPL_TYPE_INT,
00137                               "Number of A coefficients: number of "
00138                               "polynomial coefficients for the "
00139                               "dispersion relation",
00140                               "sinfoni.distortion",
00141                               4);
00142 
00143   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-n_a_coeffs");
00144   cpl_parameterlist_append(list, p);
00145 
00146  /* # of polynomial coefficients used for the fit of the dispersion coefficients */
00147   p = cpl_parameter_new_value("sinfoni.distortion.n_b_coefficients",
00148                   CPL_TYPE_INT,
00149                               "Number of B coefficients: "
00150                               "number of polynomial coefficients for the "
00151                               "polynomial fit of the dispersion coefficients",
00152                               "sinfoni.distortion",
00153                               2);
00154 
00155   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-n_b_coeffs");
00156   cpl_parameterlist_append(list, p);
00157 
00158  /* minimal factor of the standard deviation of the fit coefficients */
00159   p = cpl_parameter_new_value("sinfoni.distortion.sigma_factor",
00160                   CPL_TYPE_DOUBLE,
00161                               "Sigma Factor: "
00162                               "Factor of the standard deviation of the "
00163                               "polynomial coefficients of the dispersion "
00164                               "relation beyond which the coefficients are "
00165                               "not used for the fit",
00166                               "sinfoni.distortion",
00167                               1.5);
00168 
00169   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-sigma_factor");
00170   cpl_parameterlist_append(list, p);
00171 
00172   /* indicates if the parameterized dispersion relation coefficients 
00173        should be written into an ASCII file */
00174   p = cpl_parameter_new_value("sinfoni.distortion.write_coeffs_ind",
00175                   CPL_TYPE_BOOL,
00176                               "Write Coefficients Index: "
00177                               "indicates if the coefficients should "
00178                               "be written into a file or not",
00179                               "sinfoni.distortion",
00180                               TRUE);
00181 
00182   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-wcoeff_ind");
00183   cpl_parameterlist_append(list, p);
00184 
00185   /* indicates if the fit parameters should be written into an ASCII file */
00186   p = cpl_parameter_new_value("sinfoni.distortion.write_par_ind",
00187                   CPL_TYPE_BOOL,
00188                               "Write Parameter Index: "
00189                               "indicates if the fit parameters should "
00190                               "be written into a file or not ",
00191                               "sinfoni.distortion",
00192                               TRUE);
00193 
00194   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-par_ind");
00195   cpl_parameterlist_append(list, p);
00196 
00197 
00198   /* minimal distance of the slitlets in spectral direction */
00199   p = cpl_parameter_new_value("sinfoni.distortion.pixel_dist",
00200                   CPL_TYPE_INT,
00201                          "Minimal Slitlets's Distance in spectral direction",
00202                               "sinfoni.distortion",
00203                               12);
00204 
00205   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-pixel_dist");
00206   cpl_parameterlist_append(list, p);
00207 
00208 
00209 
00210   /* allowed pixel position tolerance between estimated and fitted line 
00211      position
00212   */
00213   p = cpl_parameter_new_value("sinfoni.distortion.pixel_tol",
00214                   CPL_TYPE_DOUBLE,
00215                               "Pixel Tolerance: allowed pixel position "
00216                               "tolerance between estimated and fitted "
00217                   "line position",
00218                               "sinfoni.distortion",
00219                               3.0);
00220 
00221   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-pixel_tol");
00222   cpl_parameterlist_append(list, p);
00223 
00224   /* Wavelength Map */
00225 /* indicator if wavelength map should be generated or not */
00226   p = cpl_parameter_new_value("sinfoni.distortion.wave_map_ind",
00227                   CPL_TYPE_BOOL,
00228                               "Wavelength Map Indicator: "
00229                               "indicates if the wavelength calibration map "
00230                               "should be generated (TRUE) or not (FALSE)",
00231                               "sinfoni.distortion",
00232                               FALSE);
00233 
00234   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-wave_map_ind");
00235   cpl_parameterlist_append(list, p);
00236 
00237   /* magnifying factor for FFT */
00238   p = cpl_parameter_new_value("sinfoni.distortion.mag_factor",
00239                   CPL_TYPE_INT,
00240                               "Magnificator Factor: "
00241                               "magnifying factor for the number of pixels "
00242                               "in the columns needed for FFT",
00243                               "sinfoni.distortion",
00244                               8);
00245 
00246   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-mag_factor");
00247   cpl_parameterlist_append(list, p);
00248 
00249 /* Fits Slits */
00250 /* indicator if the fit of the slit edge positions is carried through or not */
00251   p = cpl_parameter_new_value("sinfoni.distortion.slit_pos_indicator",
00252                   CPL_TYPE_BOOL,
00253                               "Slit Position Indicator: "
00254                               "indicates if the fits of the slitlet "
00255                               "edge positions should be carried "
00256                               "through or not",
00257                               "sinfoni.distortion",
00258                               TRUE);
00259 
00260   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-slit_pos_ind");
00261   cpl_parameterlist_append(list, p);
00262 
00263 /* indicator if the fit model function is a Boltzmann function or not */
00264   p = cpl_parameter_new_value("sinfoni.distortion.fit_boltz_indicator",
00265                   CPL_TYPE_BOOL ,
00266                               "Fit Boltzmann Indicator: "
00267                               "indicates if the fits of the slitlet edge "
00268                               "positions is carried trough by using a "
00269                               "Boltzmann function as model function",
00270                               "sinfoni.distortion",
00271                               TRUE);
00272 
00273   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-fit_boltz_ind");
00274   cpl_parameterlist_append(list, p);
00275 
00276 /* indicator if the fit model function is a simple edge function or not */
00277   p = cpl_parameter_new_value("sinfoni.distortion.fit_edge_indicator",
00278                   CPL_TYPE_BOOL,
00279                               "Fit Edge Indicator: "
00280                               "indicates if the fits of the slitlet edge "
00281                               "positions is carried through by using a "
00282                               "simple edge function as model function",
00283                               "sinfoni.distortion",
00284                               FALSE);
00285 
00286   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-fit_edge_ind");
00287   cpl_parameterlist_append(list, p);
00288 
00289  /* indicator if the fit guess position are user given or calculated automatically */
00290 
00291   p = cpl_parameter_new_value("sinfoni.distortion.estimate_indicator",
00292                   CPL_TYPE_BOOL,
00293                               "Estimate Indicator: "
00294                               "indicates if the fits of the slitlet edge "
00295                               "positions is carried through by using a list "
00296                               "of estimated guess positions in a file (TRUE)"
00297                               "or if the initial positions are calculated "
00298                               "automatically (FALSE). The estimation case "
00299                               "is more stable",
00300                               "sinfoni.distortion",
00301                               FALSE);
00302 
00303   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-estimate_ind");
00304   cpl_parameterlist_append(list, p);
00305 
00306 /* pixel length of the row box within which the fit of the slitlet positions is carried out*/
00307 
00308   p = cpl_parameter_new_value("sinfoni.distortion.box_length",
00309                   CPL_TYPE_INT,
00310                               "Box Length: "
00311                               "pixel length of the row box within "
00312                               "which the fit is carried out",
00313                               "sinfoni.distortion",
00314                               32);
00315 
00316   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-box_len");
00317   cpl_parameterlist_append(list, p);
00318 
00319 /* float box half width in spectral direction */
00320   p = cpl_parameter_new_value("sinfoni.distortion.y_box",
00321                   CPL_TYPE_DOUBLE,
00322                               "Y Box: half width of a small box in "
00323                               "spectral direction within which the "
00324                               "maximal intensity pixel is searched",
00325                               "sinfoni.distortion",
00326                               5.);
00327 
00328  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-y_box");
00329   cpl_parameterlist_append(list, p);
00330 
00331 /* maximal tolerable difference to the expected slitlet positions */
00332   p = cpl_parameter_new_value("sinfoni.distortion.diff_tol",
00333                   CPL_TYPE_DOUBLE,
00334                               "Difference Tolearance: "
00335                               "maximal tolerable difference of the "
00336                               "resulting fit positions of the slitlet "
00337                               "edges with respect to the expected positions",
00338                               "sinfoni.distortion",
00339                               2.);
00340 
00341   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-diff_toll");
00342   cpl_parameterlist_append(list, p);
00343 
00344 
00345  p = cpl_parameter_new_value("sinfoni.distortion.qc_thresh_min",
00346                   CPL_TYPE_INT,
00347                               "qc_thresh_min",
00348                               "sinfoni.distortion",
00349                               0);
00350 
00351   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-qc_thresh_min");
00352   cpl_parameterlist_append(list, p);
00353 
00354 
00355   p = cpl_parameter_new_value("sinfoni.distortion.qc_thresh_max",
00356                   CPL_TYPE_INT,
00357                               "qc_thresh_max",
00358                               "sinfoni.distortion",
00359                               49000);
00360 
00361   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-qc_thresh_max");
00362   cpl_parameterlist_append(list, p);
00363 
00364 
00365 
00366 
00367 
00368 
00369   /* NORD SOUTH TEST */
00370 
00371 
00372 
00373   /* Clean Mean */
00374   p = cpl_parameter_new_range("sinfoni.distortion.lower_rejection",
00375                   CPL_TYPE_DOUBLE,
00376                               "lower rejection: "
00377                               "percentage of rejected low intensity pixels "
00378                               "before averaging",
00379                               "sinfoni.distortion",
00380                                0.1,0.0,1.0);
00381 
00382   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"ns-lo_rejection");
00383   cpl_parameterlist_append(list, p);
00384 
00385   p = cpl_parameter_new_range("sinfoni.distortion.higher_rejection",
00386                   CPL_TYPE_DOUBLE,
00387                               "higher rejection: "
00388                               "percentage of rejected high intensity pixels "
00389                               "before averaging",
00390                               "sinfoni.distortion",
00391                               0.1,0.0,1.0);
00392 
00393   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"ns-hi_rejection");
00394   cpl_parameterlist_append(list, p);
00395 
00396 
00397   p = cpl_parameter_new_value("sinfoni.distortion.mask_ind",
00398                   CPL_TYPE_BOOL,
00399                               "Mask Index: "
00400                              "indicator if a bad pixel mask is applied or not",
00401                               "sinfoni.distortion",
00402                               FALSE);
00403 
00404   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"ns-mask_ind");
00405   cpl_parameterlist_append(list, p);
00406 
00407 
00408   /* Gauss Convolution */
00409   p = cpl_parameter_new_value("sinfoni.distortion.gauss_ind",
00410                   CPL_TYPE_BOOL,
00411                               "Gauss Index: ",
00412                               "sinfoni.distortion",
00413                               FALSE);
00414 
00415   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"ns-gauss_ind");
00416   cpl_parameterlist_append(list, p);
00417 
00418   p = cpl_parameter_new_value("sinfoni.distortion.kernel_half_width",
00419                   CPL_TYPE_INT,
00420                               "Kernel Half Width "
00421                               "kernel half width of the Gaussian "
00422                               "response function",
00423                               "sinfoni.distortion",
00424                                2);
00425 
00426   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"ns-khw");
00427   cpl_parameterlist_append(list, p);
00428 
00429 
00430 
00431   /* North South Test */
00432 
00433 
00434 
00435   p = cpl_parameter_new_value("sinfoni.distortion.ns_half_width",
00436                   CPL_TYPE_INT,
00437                               "Half Width",
00438                               "sinfoni.distortion",
00439                                4);
00440 
00441   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"ns-hw");
00442   cpl_parameterlist_append(list, p);
00443 
00444   p = cpl_parameter_new_value("sinfoni.distortion.ns_fwhm",
00445                   CPL_TYPE_DOUBLE,
00446                               "FWHM",
00447                               "sinfoni.distortion",
00448                                2.);
00449 
00450   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"ns-fwhm");
00451   cpl_parameterlist_append(list, p);
00452 
00453 
00454   p = cpl_parameter_new_value("sinfoni.distortion.min_diff",
00455                   CPL_TYPE_DOUBLE,
00456                               "Minimum of Difference",
00457                               "sinfoni.distortion",
00458                               1.);
00459 
00460   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"ns-min_diff");
00461   cpl_parameterlist_append(list, p);
00462 
00463 
00464   p = cpl_parameter_new_value("sinfoni.distortion.dev_tol",
00465                   CPL_TYPE_DOUBLE,
00466                               "Dev Tol",
00467                               "sinfoni.distortion",
00468                               20.);
00469 
00470 
00471   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"ns-dev_tol");
00472   cpl_parameterlist_append(list, p);
00473 
00474 }

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