sinfo_distortion_config.c

00001 /* $Id: sinfo_distortion_config.c,v 1.6 2012/03/02 08:42:20 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: 2012/03/02 08:42:20 $
00023  * $Revision: 1.6 $
00024  * $Name: HEAD $
00025  */
00026 #ifdef HAVE_CONFIG_H
00027 #  include <config.h>
00028 #endif
00029 
00030  /****************************************************************
00031   *   Wavecal Frames Data Reduction Parameter Initialization        *
00032   ****************************************************************/
00033 
00034 #include "sinfo_distortion_config.h"
00035 #include "sinfo_globals.h"
00037 /*---------------------------------------------------------------------------*/
00041 /*---------------------------------------------------------------------------*/
00042 
00043  void
00044  sinfo_distortion_config_add(cpl_parameterlist *list)
00045 {
00046 
00047   cpl_parameter *p;
00048 
00049   if (!list) {
00050     return;
00051   }
00052 
00053   /* Output file name */
00054 /* output name of resulting fits wavelength map */
00055 
00056 
00057 /* Find Lines */
00058 /* indicates if the dispersion relation is already determined or not */
00059   p = cpl_parameter_new_value("sinfoni.distortion.calib_indicator",
00060                   CPL_TYPE_BOOL,
00061                               "Calib Indicator: "
00062                               "FALSE: if the dispersion relation is already "
00063                               "known, the routine can jump to the waveMap "
00064                               "section "
00065                               "TRUE: if the dispersion relation "
00066                               "must first be determined",
00067                               "sinfoni.distortion",
00068                               TRUE);
00069 
00070   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-calib_indicator");
00071   cpl_parameterlist_append(list, p);
00072 
00073 
00074 /* minimal difference of mean and sinfo_median column intensity */
00075   p = cpl_parameter_new_value("sinfoni.distortion.min_diff_mean_med_col_int",
00076                   CPL_TYPE_DOUBLE,
00077                               "Minimum Of Difference: "
00078                               "minimum difference of mean and median column "
00079                               "intensity to carry out the cross correlation",
00080                               "sinfoni.distortion",
00081                               10.);
00082 
00083   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
00084                           "dist-min_diff_mean_med_col_int");
00085   cpl_parameterlist_append(list, p);
00086 
00087 /* half width of a box within which the line must sit */
00088   p = cpl_parameter_new_value("sinfoni.distortion.half_width",
00089                   CPL_TYPE_INT,
00090                               "Half Width: "
00091                               "half width of a box within which the line "
00092                               "must be placed",
00093                               "sinfoni.distortion",
00094                               7);
00095 
00096   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-hw");
00097   cpl_parameterlist_append(list, p);
00098 
00099 /* sigma of Gaussian of artificial model spectra */
00100   p = cpl_parameter_new_value("sinfoni.distortion.sigma",
00101                   CPL_TYPE_DOUBLE,
00102                               "Sigma: sigma of Gaussian which is convolved "
00103                               "with the artificial spectrum generated using "
00104                               "the line list",
00105                               "sinfoni.distortion",
00106                                2.);
00107 
00108   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-sigma");
00109   cpl_parameterlist_append(list, p);
00110 
00111   /* Wavelength Calibration */
00112 /* guess value for fwhm of emission lines */
00113   p = cpl_parameter_new_value("sinfoni.distortion.fwhm",
00114                   CPL_TYPE_DOUBLE,
00115                               "FWHM: initial guess value for the fwhm of "
00116                               "the Gaussian used for the line fit",
00117                               "sinfoni.distortion",
00118                                2.83);
00119 
00120   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-fwhm");
00121   cpl_parameterlist_append(list, p);
00122 
00123 /* minimum amplitude of a line to be fitted */
00124   p = cpl_parameter_new_value("sinfoni.distortion.min_amplitude",
00125                   CPL_TYPE_DOUBLE,
00126                               "Minimum Of Amplitude: "
00127                               "of the Gaussian to do the fit",
00128                               "sinfoni.distortion",
00129                               5.);
00130 
00131   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-min_amplitude");
00132   cpl_parameterlist_append(list, p);
00133 
00134 /* maximal residual value for a valid fit */
00135   p = cpl_parameter_new_value("sinfoni.distortion.max_residual",
00136                   CPL_TYPE_DOUBLE,
00137                               "Maximum Residuals value: "
00138                               "beyond this value the fit is rejected",
00139                               "sinfoni.distortion",
00140                               0.5);
00141 
00142   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-max_residual");
00143   cpl_parameterlist_append(list, p);
00144 
00145 /* # of polynomial coefficients used for the dispersion relation */
00146   p = cpl_parameter_new_value("sinfoni.distortion.n_a_coefficients",
00147                   CPL_TYPE_INT,
00148                               "Number of A coefficients: number of "
00149                               "polynomial coefficients for the "
00150                               "dispersion relation",
00151                               "sinfoni.distortion",
00152                               4);
00153 
00154   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-n_a_coeffs");
00155   cpl_parameterlist_append(list, p);
00156 
00157  /* # of polynomial coefficients used for the fit of the dispersion 
00158     coefficients */
00159   p = cpl_parameter_new_value("sinfoni.distortion.n_b_coefficients",
00160                   CPL_TYPE_INT,
00161                               "Number of B coefficients: "
00162                               "number of polynomial coefficients for the "
00163                               "polynomial fit of the dispersion coefficients",
00164                               "sinfoni.distortion",
00165                               2);
00166 
00167   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-n_b_coeffs");
00168   cpl_parameterlist_append(list, p);
00169 
00170  /* minimal factor of the standard deviation of the fit coefficients */
00171   p = cpl_parameter_new_value("sinfoni.distortion.sigma_factor",
00172                   CPL_TYPE_DOUBLE,
00173                               "Sigma Factor: "
00174                               "Factor of the standard deviation of the "
00175                               "polynomial coefficients of the dispersion "
00176                               "relation beyond which the coefficients are "
00177                               "not used for the fit",
00178                               "sinfoni.distortion",
00179                               1.5);
00180 
00181   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-sigma_factor");
00182   cpl_parameterlist_append(list, p);
00183 
00184   /* indicates if the parameterized dispersion relation coefficients 
00185        should be written into an ASCII file */
00186   p = cpl_parameter_new_value("sinfoni.distortion.write_coeffs_ind",
00187                   CPL_TYPE_BOOL,
00188                               "Write Coefficients Index: "
00189                               "indicates if the coefficients 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-wcoeff_ind");
00195   cpl_parameterlist_append(list, p);
00196 
00197   /* indicates if the fit parameters should be written into an ASCII file */
00198   p = cpl_parameter_new_value("sinfoni.distortion.write_par_ind",
00199                   CPL_TYPE_BOOL,
00200                               "Write Parameter Index: "
00201                               "indicates if the fit parameters should "
00202                               "be written into a file or not ",
00203                               "sinfoni.distortion",
00204                               TRUE);
00205 
00206   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-par_ind");
00207   cpl_parameterlist_append(list, p);
00208 
00209 
00210   /* minimal distance of the slitlets in spectral direction */
00211   p = cpl_parameter_new_value("sinfoni.distortion.pixel_dist",
00212                   CPL_TYPE_INT,
00213                          "Minimal Slitlets's Distance in spectral direction",
00214                               "sinfoni.distortion",
00215                               15);
00216 
00217   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-pixel_dist");
00218   cpl_parameterlist_append(list, p);
00219 
00220 
00221 
00222   /* allowed pixel position tolerance between estimated and fitted line 
00223      position
00224   */
00225   p = cpl_parameter_new_value("sinfoni.distortion.pixel_tol",
00226                   CPL_TYPE_DOUBLE,
00227                               "Pixel Tolerance: allowed pixel position "
00228                               "tolerance between estimated and fitted "
00229                   "line position",
00230                               "sinfoni.distortion",
00231                               5.0);
00232 
00233   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-pixel_tol");
00234   cpl_parameterlist_append(list, p);
00235 
00236   /* Wavelength Map */
00237 /* indicator if wavelength map should be generated or not */
00238   p = cpl_parameter_new_value("sinfoni.distortion.wave_map_ind",
00239                   CPL_TYPE_BOOL,
00240                               "Wavelength Map Indicator: "
00241                               "indicates if the wavelength calibration map "
00242                               "should be generated (TRUE) or not (FALSE)",
00243                               "sinfoni.distortion",
00244                               FALSE);
00245 
00246   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-wave_map_ind");
00247   cpl_parameterlist_append(list, p);
00248 
00249   /* magnifying factor for FFT */
00250   p = cpl_parameter_new_value("sinfoni.distortion.mag_factor",
00251                   CPL_TYPE_INT,
00252                               "Magnificator Factor: "
00253                               "magnifying factor for the number of pixels "
00254                               "in the columns needed for FFT",
00255                               "sinfoni.distortion",
00256                               8);
00257 
00258   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-mag_factor");
00259   cpl_parameterlist_append(list, p);
00260 
00261 /* Fits Slits */
00262 /* indicator if the fit of the slit edge positions is carried through or not */
00263   p = cpl_parameter_new_value("sinfoni.distortion.slit_pos_indicator",
00264                   CPL_TYPE_BOOL,
00265                               "Slit Position Indicator: "
00266                               "indicates if the fits of the slitlet "
00267                               "edge positions should be carried "
00268                               "through or not",
00269                               "sinfoni.distortion",
00270                               TRUE);
00271 
00272   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-slit_pos_ind");
00273   cpl_parameterlist_append(list, p);
00274 
00275 /* indicator if the fit model function is a Boltzmann function or not */
00276   p = cpl_parameter_new_value("sinfoni.distortion.fit_boltz_indicator",
00277                   CPL_TYPE_BOOL ,
00278                               "Fit Boltzmann Indicator: "
00279                               "indicates if the fits of the slitlet edge "
00280                               "positions is carried trough by using a "
00281                               "Boltzmann function as model function",
00282                               "sinfoni.distortion",
00283                               TRUE);
00284 
00285   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-fit_boltz_ind");
00286   cpl_parameterlist_append(list, p);
00287 
00288 /* indicator if the fit model function is a simple edge function or not */
00289   p = cpl_parameter_new_value("sinfoni.distortion.fit_edge_indicator",
00290                   CPL_TYPE_BOOL,
00291                               "Fit Edge Indicator: "
00292                               "indicates if the fits of the slitlet edge "
00293                               "positions is carried through by using a "
00294                               "simple edge function as model function",
00295                               "sinfoni.distortion",
00296                               FALSE);
00297 
00298   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-fit_edge_ind");
00299   cpl_parameterlist_append(list, p);
00300 
00301  /* indicator if the fit guess position are user 
00302     given or calculated automatically */
00303 
00304   p = cpl_parameter_new_value("sinfoni.distortion.estimate_indicator",
00305                   CPL_TYPE_BOOL,
00306                               "Estimate Indicator: "
00307                               "indicates if the fits of the slitlet edge "
00308                               "positions is carried through by using a list "
00309                               "of estimated guess positions in a file (TRUE)"
00310                               "or if the initial positions are calculated "
00311                               "automatically (FALSE). The estimation case "
00312                               "is more stable",
00313                               "sinfoni.distortion",
00314                               FALSE);
00315 
00316   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-estimate_ind");
00317   cpl_parameterlist_append(list, p);
00318 
00319 /* pixel length of the row box within which 
00320    the fit of the slitlet positions is carried out*/
00321 
00322   p = cpl_parameter_new_value("sinfoni.distortion.box_length",
00323                   CPL_TYPE_INT,
00324                               "Box Length: "
00325                               "pixel length of the row box within "
00326                               "which the fit is carried out",
00327                               "sinfoni.distortion",
00328                               32);
00329 
00330   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-box_len");
00331   cpl_parameterlist_append(list, p);
00332 
00333 /* float box half width in spectral direction */
00334   p = cpl_parameter_new_value("sinfoni.distortion.y_box",
00335                   CPL_TYPE_DOUBLE,
00336                               "Y Box: half width of a small box in "
00337                               "spectral direction within which the "
00338                               "maximal intensity pixel is searched",
00339                               "sinfoni.distortion",
00340                               5.);
00341 
00342  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-y_box");
00343   cpl_parameterlist_append(list, p);
00344 
00345 /* maximal tolerable difference to the expected slitlet positions */
00346   p = cpl_parameter_new_value("sinfoni.distortion.diff_tol",
00347                   CPL_TYPE_DOUBLE,
00348                               "Difference Tolearance: "
00349                               "maximal tolerable difference of the "
00350                               "resulting fit positions of the slitlet "
00351                               "edges with respect to the expected positions",
00352                               "sinfoni.distortion",
00353                               2.);
00354 
00355   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-diff_toll");
00356   cpl_parameterlist_append(list, p);
00357 
00358 
00359  p = cpl_parameter_new_value("sinfoni.distortion.qc_thresh_min",
00360                   CPL_TYPE_INT,
00361                               "qc_thresh_min",
00362                               "sinfoni.distortion",
00363                               0);
00364 
00365   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-qc_thresh_min");
00366   cpl_parameterlist_append(list, p);
00367 
00368 
00369   p = cpl_parameter_new_value("sinfoni.distortion.qc_thresh_max",
00370                   CPL_TYPE_INT,
00371                               "qc_thresh_max",
00372                               "sinfoni.distortion",
00373                               49000);
00374 
00375   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"dist-qc_thresh_max");
00376   cpl_parameterlist_append(list, p);
00377 
00378 
00379 
00380 
00381 
00382 
00383   /* NORD SOUTH TEST */
00384 
00385 
00386 
00387   /* Clean Mean */
00388   p = cpl_parameter_new_range("sinfoni.distortion.lower_rejection",
00389                   CPL_TYPE_DOUBLE,
00390                               "lower rejection: "
00391                               "percentage of rejected low intensity pixels "
00392                               "before averaging",
00393                               "sinfoni.distortion",
00394                                0.1,0.0,1.0);
00395 
00396   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"ns-lo_rejection");
00397   cpl_parameterlist_append(list, p);
00398 
00399   p = cpl_parameter_new_range("sinfoni.distortion.higher_rejection",
00400                   CPL_TYPE_DOUBLE,
00401                               "higher rejection: "
00402                               "percentage of rejected high intensity pixels "
00403                               "before averaging",
00404                               "sinfoni.distortion",
00405                               0.1,0.0,1.0);
00406 
00407   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"ns-hi_rejection");
00408   cpl_parameterlist_append(list, p);
00409 
00410 
00411   p = cpl_parameter_new_value("sinfoni.distortion.mask_ind",
00412                   CPL_TYPE_BOOL,
00413                               "Mask Index: "
00414                              "indicator if a bad pixel mask is applied or not",
00415                               "sinfoni.distortion",
00416                               FALSE);
00417 
00418   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"ns-mask_ind");
00419   cpl_parameterlist_append(list, p);
00420 
00421 
00422   /* Gauss Convolution */
00423   p = cpl_parameter_new_value("sinfoni.distortion.gauss_ind",
00424                   CPL_TYPE_BOOL,
00425                               "Gauss Index: ",
00426                               "sinfoni.distortion",
00427                               FALSE);
00428 
00429   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"ns-gauss_ind");
00430   cpl_parameterlist_append(list, p);
00431 
00432   p = cpl_parameter_new_value("sinfoni.distortion.kernel_half_width",
00433                   CPL_TYPE_INT,
00434                               "Kernel Half Width "
00435                               "kernel half width of the Gaussian "
00436                               "response function",
00437                               "sinfoni.distortion",
00438                                2);
00439 
00440   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"ns-khw");
00441   cpl_parameterlist_append(list, p);
00442 
00443 
00444 
00445   /* North South Test */
00446 
00447 
00448 
00449   p = cpl_parameter_new_value("sinfoni.distortion.ns_half_width",
00450                   CPL_TYPE_INT,
00451                               "Half Width",
00452                               "sinfoni.distortion",
00453                                4);
00454 
00455   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"ns-hw");
00456   cpl_parameterlist_append(list, p);
00457 
00458   p = cpl_parameter_new_value("sinfoni.distortion.ns_fwhm",
00459                   CPL_TYPE_DOUBLE,
00460                               "FWHM",
00461                               "sinfoni.distortion",
00462                                2.);
00463 
00464   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"ns-fwhm");
00465   cpl_parameterlist_append(list, p);
00466 
00467 
00468   p = cpl_parameter_new_value("sinfoni.distortion.min_diff",
00469                   CPL_TYPE_DOUBLE,
00470                               "Minimum of Difference",
00471                               "sinfoni.distortion",
00472                               1.);
00473 
00474   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"ns-min_diff");
00475   cpl_parameterlist_append(list, p);
00476 
00477 
00478   p = cpl_parameter_new_value("sinfoni.distortion.dev_tol",
00479                   CPL_TYPE_DOUBLE,
00480                               "Dev Tol",
00481                               "sinfoni.distortion",
00482                               20.);
00483 
00484 
00485   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"ns-dev_tol");
00486   cpl_parameterlist_append(list, p);
00487 
00488 
00489   p = cpl_parameter_new_value("sinfoni.distortion.arcs_thresh_factor",
00490                   CPL_TYPE_DOUBLE,
00491                               "arcs threshold factor. "
00492                               "median_value(image)+ kappa*sigma is the "
00493                               "minimum intensity threshold of accepted image"
00494                               "pixels",
00495                               "sinfoni.distortion",
00496                               0.33333);
00497 
00498 
00499   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"arcs_thresh_factor");
00500   cpl_parameterlist_append(list, p);
00501 
00502 
00503 
00504   p = cpl_parameter_new_value("sinfoni.distortion.arcs_min_arclen_factor",
00505                   CPL_TYPE_DOUBLE,
00506                               "factor which sets minimum arc length (1.0-2)",
00507                               "sinfoni.distortion",
00508                               1.19);
00509 
00510 
00511   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"arcs_min_arclen_factor");
00512   cpl_parameterlist_append(list, p);
00513 
00514 
00515   p = cpl_parameter_new_value("sinfoni.distortion.arcs_window_size",
00516                   CPL_TYPE_INT,
00517                               "Size of window for low pass fileter used in"
00518                               "an horizzontal low pass filter to remove "
00519                               "unwanted arcs (5-64)",
00520                               "sinfoni.distortion",
00521                               14);
00522 
00523 
00524   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"arcs_window_size");
00525   cpl_parameterlist_append(list, p);
00526 
00527 
00528   p = cpl_parameter_new_value("sinfoni.distortion.smooth_rad",
00529                   CPL_TYPE_INT,
00530                               "Size of smoothing factor (1-11) used to "
00531                               "prevent for possible intensity drops from "
00532                               "detector electronics on fibre illuminated "
00533                               "slitlets (1-11)",
00534                               "sinfoni.distortion",
00535                               3);
00536 
00537 
00538   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"smooth_rad");
00539   cpl_parameterlist_append(list, p);
00540 
00541 }

Generated on 3 Mar 2013 for SINFONI Pipeline Reference Manual by  doxygen 1.6.1