sinfo_distortion_config.c

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

Generated on 8 Mar 2011 for SINFONI Pipeline Reference Manual by  doxygen 1.6.1